pub struct Builder { /* private fields */ }Expand description
A builder for CreateCodeReviewOutput.
Implementations§
source§impl Builder
impl Builder
sourcepub fn code_review(self, input: CodeReview) -> Self
pub fn code_review(self, input: CodeReview) -> Self
Information about a code review. A code review belongs to the associated repository that contains the reviewed code.
sourcepub fn set_code_review(self, input: Option<CodeReview>) -> Self
pub fn set_code_review(self, input: Option<CodeReview>) -> Self
Information about a code review. A code review belongs to the associated repository that contains the reviewed code.
Examples found in repository?
src/json_deser.rs (lines 374-376)
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
pub(crate) fn deser_operation_crate_operation_create_code_review(
value: &[u8],
mut builder: crate::output::create_code_review_output::Builder,
) -> Result<
crate::output::create_code_review_output::Builder,
aws_smithy_json::deserialize::error::DeserializeError,
> {
let mut tokens_owned =
aws_smithy_json::deserialize::json_token_iter(crate::json_deser::or_empty_doc(value))
.peekable();
let tokens = &mut tokens_owned;
aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"CodeReview" => {
builder = builder.set_code_review(
crate::json_deser::deser_structure_crate_model_code_review(tokens)?,
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
if tokens.next().is_some() {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"found more JSON tokens after completing parsing",
),
);
}
Ok(builder)
}sourcepub fn build(self) -> CreateCodeReviewOutput
pub fn build(self) -> CreateCodeReviewOutput
Consumes the builder and constructs a CreateCodeReviewOutput.
Examples found in repository?
src/operation_deser.rs (line 265)
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
pub fn parse_create_code_review_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateCodeReviewOutput, crate::error::CreateCodeReviewError>
{
Ok({
#[allow(unused_mut)]
let mut output = crate::output::create_code_review_output::Builder::default();
let _ = response;
output = crate::json_deser::deser_operation_crate_operation_create_code_review(
response.body().as_ref(),
output,
)
.map_err(crate::error::CreateCodeReviewError::unhandled)?;
output.build()
})
}