pub struct Builder { /* private fields */ }Expand description
A builder for CreateLanguageModelOutput.
Implementations§
source§impl Builder
impl Builder
sourcepub fn language_code(self, input: ClmLanguageCode) -> Self
pub fn language_code(self, input: ClmLanguageCode) -> Self
The language code you selected for your custom language model.
sourcepub fn set_language_code(self, input: Option<ClmLanguageCode>) -> Self
pub fn set_language_code(self, input: Option<ClmLanguageCode>) -> Self
The language code you selected for your custom language model.
Examples found in repository?
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
pub(crate) fn deser_operation_crate_operation_create_language_model(
value: &[u8],
mut builder: crate::output::create_language_model_output::Builder,
) -> Result<
crate::output::create_language_model_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() {
"LanguageCode" => {
builder = builder.set_language_code(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ClmLanguageCode::from(u.as_ref()))
})
.transpose()?,
);
}
"BaseModelName" => {
builder = builder.set_base_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::BaseModelName::from(u.as_ref()))
})
.transpose()?,
);
}
"ModelName" => {
builder = builder.set_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"InputDataConfig" => {
builder = builder.set_input_data_config(
crate::json_deser::deser_structure_crate_model_input_data_config(
tokens,
)?,
);
}
"ModelStatus" => {
builder = builder.set_model_status(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ModelStatus::from(u.as_ref()))
})
.transpose()?,
);
}
_ => 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 base_model_name(self, input: BaseModelName) -> Self
pub fn base_model_name(self, input: BaseModelName) -> Self
The Amazon Transcribe standard language model, or base model, you specified when creating your custom language model.
sourcepub fn set_base_model_name(self, input: Option<BaseModelName>) -> Self
pub fn set_base_model_name(self, input: Option<BaseModelName>) -> Self
The Amazon Transcribe standard language model, or base model, you specified when creating your custom language model.
Examples found in repository?
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
pub(crate) fn deser_operation_crate_operation_create_language_model(
value: &[u8],
mut builder: crate::output::create_language_model_output::Builder,
) -> Result<
crate::output::create_language_model_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() {
"LanguageCode" => {
builder = builder.set_language_code(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ClmLanguageCode::from(u.as_ref()))
})
.transpose()?,
);
}
"BaseModelName" => {
builder = builder.set_base_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::BaseModelName::from(u.as_ref()))
})
.transpose()?,
);
}
"ModelName" => {
builder = builder.set_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"InputDataConfig" => {
builder = builder.set_input_data_config(
crate::json_deser::deser_structure_crate_model_input_data_config(
tokens,
)?,
);
}
"ModelStatus" => {
builder = builder.set_model_status(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ModelStatus::from(u.as_ref()))
})
.transpose()?,
);
}
_ => 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 model_name(self, input: impl Into<String>) -> Self
pub fn model_name(self, input: impl Into<String>) -> Self
The name of your custom language model.
sourcepub fn set_model_name(self, input: Option<String>) -> Self
pub fn set_model_name(self, input: Option<String>) -> Self
The name of your custom language model.
Examples found in repository?
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
pub(crate) fn deser_operation_crate_operation_create_language_model(
value: &[u8],
mut builder: crate::output::create_language_model_output::Builder,
) -> Result<
crate::output::create_language_model_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() {
"LanguageCode" => {
builder = builder.set_language_code(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ClmLanguageCode::from(u.as_ref()))
})
.transpose()?,
);
}
"BaseModelName" => {
builder = builder.set_base_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::BaseModelName::from(u.as_ref()))
})
.transpose()?,
);
}
"ModelName" => {
builder = builder.set_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"InputDataConfig" => {
builder = builder.set_input_data_config(
crate::json_deser::deser_structure_crate_model_input_data_config(
tokens,
)?,
);
}
"ModelStatus" => {
builder = builder.set_model_status(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ModelStatus::from(u.as_ref()))
})
.transpose()?,
);
}
_ => 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 input_data_config(self, input: InputDataConfig) -> Self
pub fn input_data_config(self, input: InputDataConfig) -> Self
Lists your data access role ARN (Amazon Resource Name) and the Amazon S3 locations you provided for your training (S3Uri) and tuning (TuningDataS3Uri) data.
sourcepub fn set_input_data_config(self, input: Option<InputDataConfig>) -> Self
pub fn set_input_data_config(self, input: Option<InputDataConfig>) -> Self
Lists your data access role ARN (Amazon Resource Name) and the Amazon S3 locations you provided for your training (S3Uri) and tuning (TuningDataS3Uri) data.
Examples found in repository?
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
pub(crate) fn deser_operation_crate_operation_create_language_model(
value: &[u8],
mut builder: crate::output::create_language_model_output::Builder,
) -> Result<
crate::output::create_language_model_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() {
"LanguageCode" => {
builder = builder.set_language_code(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ClmLanguageCode::from(u.as_ref()))
})
.transpose()?,
);
}
"BaseModelName" => {
builder = builder.set_base_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::BaseModelName::from(u.as_ref()))
})
.transpose()?,
);
}
"ModelName" => {
builder = builder.set_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"InputDataConfig" => {
builder = builder.set_input_data_config(
crate::json_deser::deser_structure_crate_model_input_data_config(
tokens,
)?,
);
}
"ModelStatus" => {
builder = builder.set_model_status(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ModelStatus::from(u.as_ref()))
})
.transpose()?,
);
}
_ => 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 model_status(self, input: ModelStatus) -> Self
pub fn model_status(self, input: ModelStatus) -> Self
The status of your custom language model. When the status displays as COMPLETED, your model is ready to use.
sourcepub fn set_model_status(self, input: Option<ModelStatus>) -> Self
pub fn set_model_status(self, input: Option<ModelStatus>) -> Self
The status of your custom language model. When the status displays as COMPLETED, your model is ready to use.
Examples found in repository?
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
pub(crate) fn deser_operation_crate_operation_create_language_model(
value: &[u8],
mut builder: crate::output::create_language_model_output::Builder,
) -> Result<
crate::output::create_language_model_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() {
"LanguageCode" => {
builder = builder.set_language_code(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ClmLanguageCode::from(u.as_ref()))
})
.transpose()?,
);
}
"BaseModelName" => {
builder = builder.set_base_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::BaseModelName::from(u.as_ref()))
})
.transpose()?,
);
}
"ModelName" => {
builder = builder.set_model_name(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"InputDataConfig" => {
builder = builder.set_input_data_config(
crate::json_deser::deser_structure_crate_model_input_data_config(
tokens,
)?,
);
}
"ModelStatus" => {
builder = builder.set_model_status(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| {
s.to_unescaped()
.map(|u| crate::model::ModelStatus::from(u.as_ref()))
})
.transpose()?,
);
}
_ => 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) -> CreateLanguageModelOutput
pub fn build(self) -> CreateLanguageModelOutput
Consumes the builder and constructs a CreateLanguageModelOutput.
Examples found in repository?
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
pub fn parse_create_language_model_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateLanguageModelOutput,
crate::error::CreateLanguageModelError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::create_language_model_output::Builder::default();
let _ = response;
output = crate::json_deser::deser_operation_crate_operation_create_language_model(
response.body().as_ref(),
output,
)
.map_err(crate::error::CreateLanguageModelError::unhandled)?;
output.build()
})
}