Class: AWSCDK::Codecommit::Code

Inherits:
Jsii::Object
  • Object
show all
Defined in:
codecommit/code.rb

Overview

Represents the contents to initialize the repository with.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCode

Returns a new instance of Code.



8
9
10
# File 'codecommit/code.rb', line 8

def initialize
  Jsii::Object.instance_method(:initialize).bind(self).call
end

Class Method Details

.from_asset(asset, branch = nil) ⇒ AWSCDK::Codecommit::Code

Code from user-supplied asset.

Parameters:

  • asset (AWSCDK::S3Assets::Asset)

    pre-existing asset.

  • branch (String, nil) (defaults to: nil)

    the name of the branch to create in the repository.

Returns:

  • (AWSCDK::Codecommit::Code)


23
24
25
26
27
# File 'codecommit/code.rb', line 23

def self.from_asset(asset, branch = nil)
  Jsii::Type.check_type(asset, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfYXNzZXRzLkFzc2V0In0=")), "asset")
  Jsii::Type.check_type(branch, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branch") unless branch.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codecommit.Code", "fromAsset", [asset, branch])
end

.from_directory(directory_path, branch = nil) ⇒ AWSCDK::Codecommit::Code

Code from directory.

Parameters:

  • directory_path (String)

    the path to the local directory containing the contents to initialize the repository with.

  • branch (String, nil) (defaults to: nil)

    the name of the branch to create in the repository.

Returns:

  • (AWSCDK::Codecommit::Code)


34
35
36
37
38
# File 'codecommit/code.rb', line 34

def self.from_directory(directory_path, branch = nil)
  Jsii::Type.check_type(directory_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "directoryPath")
  Jsii::Type.check_type(branch, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branch") unless branch.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codecommit.Code", "fromDirectory", [directory_path, branch])
end

.from_zip_file(file_path, branch = nil) ⇒ AWSCDK::Codecommit::Code

Code from preexisting ZIP file.

Parameters:

  • file_path (String)

    the path to the local ZIP file containing the contents to initialize the repository with.

  • branch (String, nil) (defaults to: nil)

    the name of the branch to create in the repository.

Returns:

  • (AWSCDK::Codecommit::Code)


45
46
47
48
49
# File 'codecommit/code.rb', line 45

def self.from_zip_file(file_path, branch = nil)
  Jsii::Type.check_type(file_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "filePath")
  Jsii::Type.check_type(branch, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "branch") unless branch.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_codecommit.Code", "fromZipFile", [file_path, branch])
end

.jsii_overridable_methodsObject



12
13
14
15
16
# File 'codecommit/code.rb', line 12

def self.jsii_overridable_methods
  {
    :bind => { kind: :method, name: "bind", is_optional: false },
  }
end

Instance Method Details

#bind(scope) ⇒ AWSCDK::Codecommit::CodeConfig

This method is called after a repository is passed this instance of Code in its 'code' property.

Parameters:

  • scope (Constructs::Construct)

    the binding scope.

Returns:



55
56
57
58
# File 'codecommit/code.rb', line 55

def bind(scope)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  jsii_call_method("bind", [scope])
end