1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Location of the source code for an application version.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SourceBuildInformation {
/// <p>The type of repository.</p>
/// <ul>
/// <li>
/// <p><code>Git</code></p></li>
/// <li>
/// <p><code>Zip</code></p></li>
/// </ul>
pub source_type: crate::types::SourceType,
/// <p>Location where the repository is stored.</p>
/// <ul>
/// <li>
/// <p><code>CodeCommit</code></p></li>
/// <li>
/// <p><code>S3</code></p></li>
/// </ul>
pub source_repository: crate::types::SourceRepository,
/// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
/// <ul>
/// <li>
/// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
/// <li>
/// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
/// </ul>
pub source_location: ::std::string::String,
}
impl SourceBuildInformation {
/// <p>The type of repository.</p>
/// <ul>
/// <li>
/// <p><code>Git</code></p></li>
/// <li>
/// <p><code>Zip</code></p></li>
/// </ul>
pub fn source_type(&self) -> &crate::types::SourceType {
&self.source_type
}
/// <p>Location where the repository is stored.</p>
/// <ul>
/// <li>
/// <p><code>CodeCommit</code></p></li>
/// <li>
/// <p><code>S3</code></p></li>
/// </ul>
pub fn source_repository(&self) -> &crate::types::SourceRepository {
&self.source_repository
}
/// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
/// <ul>
/// <li>
/// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
/// <li>
/// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
/// </ul>
pub fn source_location(&self) -> &str {
use std::ops::Deref;
self.source_location.deref()
}
}
impl SourceBuildInformation {
/// Creates a new builder-style object to manufacture [`SourceBuildInformation`](crate::types::SourceBuildInformation).
pub fn builder() -> crate::types::builders::SourceBuildInformationBuilder {
crate::types::builders::SourceBuildInformationBuilder::default()
}
}
/// A builder for [`SourceBuildInformation`](crate::types::SourceBuildInformation).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SourceBuildInformationBuilder {
pub(crate) source_type: ::std::option::Option<crate::types::SourceType>,
pub(crate) source_repository: ::std::option::Option<crate::types::SourceRepository>,
pub(crate) source_location: ::std::option::Option<::std::string::String>,
}
impl SourceBuildInformationBuilder {
/// <p>The type of repository.</p>
/// <ul>
/// <li>
/// <p><code>Git</code></p></li>
/// <li>
/// <p><code>Zip</code></p></li>
/// </ul>
/// This field is required.
pub fn source_type(mut self, input: crate::types::SourceType) -> Self {
self.source_type = ::std::option::Option::Some(input);
self
}
/// <p>The type of repository.</p>
/// <ul>
/// <li>
/// <p><code>Git</code></p></li>
/// <li>
/// <p><code>Zip</code></p></li>
/// </ul>
pub fn set_source_type(mut self, input: ::std::option::Option<crate::types::SourceType>) -> Self {
self.source_type = input;
self
}
/// <p>The type of repository.</p>
/// <ul>
/// <li>
/// <p><code>Git</code></p></li>
/// <li>
/// <p><code>Zip</code></p></li>
/// </ul>
pub fn get_source_type(&self) -> &::std::option::Option<crate::types::SourceType> {
&self.source_type
}
/// <p>Location where the repository is stored.</p>
/// <ul>
/// <li>
/// <p><code>CodeCommit</code></p></li>
/// <li>
/// <p><code>S3</code></p></li>
/// </ul>
/// This field is required.
pub fn source_repository(mut self, input: crate::types::SourceRepository) -> Self {
self.source_repository = ::std::option::Option::Some(input);
self
}
/// <p>Location where the repository is stored.</p>
/// <ul>
/// <li>
/// <p><code>CodeCommit</code></p></li>
/// <li>
/// <p><code>S3</code></p></li>
/// </ul>
pub fn set_source_repository(mut self, input: ::std::option::Option<crate::types::SourceRepository>) -> Self {
self.source_repository = input;
self
}
/// <p>Location where the repository is stored.</p>
/// <ul>
/// <li>
/// <p><code>CodeCommit</code></p></li>
/// <li>
/// <p><code>S3</code></p></li>
/// </ul>
pub fn get_source_repository(&self) -> &::std::option::Option<crate::types::SourceRepository> {
&self.source_repository
}
/// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
/// <ul>
/// <li>
/// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
/// <li>
/// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
/// </ul>
/// This field is required.
pub fn source_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.source_location = ::std::option::Option::Some(input.into());
self
}
/// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
/// <ul>
/// <li>
/// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
/// <li>
/// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
/// </ul>
pub fn set_source_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.source_location = input;
self
}
/// <p>The location of the source code, as a formatted string, depending on the value of <code>SourceRepository</code></p>
/// <ul>
/// <li>
/// <p>For <code>CodeCommit</code>, the format is the repository name and commit ID, separated by a forward slash. For example, <code>my-git-repo/265cfa0cf6af46153527f55d6503ec030551f57a</code>.</p></li>
/// <li>
/// <p>For <code>S3</code>, the format is the S3 bucket name and object key, separated by a forward slash. For example, <code>my-s3-bucket/Folders/my-source-file</code>.</p></li>
/// </ul>
pub fn get_source_location(&self) -> &::std::option::Option<::std::string::String> {
&self.source_location
}
/// Consumes the builder and constructs a [`SourceBuildInformation`](crate::types::SourceBuildInformation).
/// This method will fail if any of the following fields are not set:
/// - [`source_type`](crate::types::builders::SourceBuildInformationBuilder::source_type)
/// - [`source_repository`](crate::types::builders::SourceBuildInformationBuilder::source_repository)
/// - [`source_location`](crate::types::builders::SourceBuildInformationBuilder::source_location)
pub fn build(self) -> ::std::result::Result<crate::types::SourceBuildInformation, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::SourceBuildInformation {
source_type: self.source_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source_type",
"source_type was not specified but it is required when building SourceBuildInformation",
)
})?,
source_repository: self.source_repository.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source_repository",
"source_repository was not specified but it is required when building SourceBuildInformation",
)
})?,
source_location: self.source_location.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"source_location",
"source_location was not specified but it is required when building SourceBuildInformation",
)
})?,
})
}
}