aws-sdk-connectscheduling 1.2.0

AWS SDK for Amazon Connect Scheduling
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The request for <code>CreateTimeOff</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateTimeOffInput {
    /// <p>The identifier of the Connect Customer instance. This can be the ID or the ARN of the instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub instance_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the user who the time off request is for. This can be the ID or the ARN of the user.</p>
    pub user_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the shift activity that defines the type of time off being requested. This can be the ID or the ARN of the shift activity. It must be a time off activity. Activities that aren't set as <i>Requestable</i> are accepted.</p>
    pub shift_activity_id: ::std::option::Option<::std::string::String>,
    /// <p>The start of the time off window, inclusive. It must be no earlier than one year before the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub start_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The end of the time off window, exclusive. It must be after <code>StartAt</code> and no later than 24 months after the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub end_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>A description recorded on the time off request. If you omit it, the request has no description.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Controls who approves the request. <code>AWAIT_APPROVAL</code> waits for an <code>ApproveTimeOff</code> or <code>RejectTimeOff</code> call. <code>AUTOMATIC</code> has Connect Customer decide the request. For details, see <code>CreateTimeOff</code>.</p>
    pub approval_type: ::std::option::Option<crate::types::ApprovalType>,
    /// <p>Controls what happens when a configured rule fails. <code>REJECT</code>, the default, records an <code>ERROR</code> and ends the request <code>REJECTED</code>, unless the whole window is in the past. <code>OVERRIDE</code> records a <code>WARNING</code> and ends the request <code>APPROVED</code>, like the <i>Override time off rules</i> option in the Connect Customer admin website. <code>OVERRIDE</code> requires <code>AUTOMATIC</code>. With <code>AWAIT_APPROVAL</code>, <code>OVERRIDE</code> fails with <code>ValidationException</code>. Set it on <code>ApproveTimeOff</code> instead. <code>OVERRIDE</code> never waives <code>CONFLICTING_TIME_OFF_REQUEST</code>.</p>
    pub rule_failure_action: ::std::option::Option<crate::types::RuleFailureAction>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If this token matches a previous request, Connect Customer returns the result of that request and doesn't create another time off request. If you don't provide a token, the AWS SDK populates this field. If you reuse a client token with a different request body, the request fails with <code>ValidationException</code>. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateTimeOffInput {
    /// <p>The identifier of the Connect Customer instance. This can be the ID or the ARN of the instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
        self.instance_id.as_deref()
    }
    /// <p>The identifier of the user who the time off request is for. This can be the ID or the ARN of the user.</p>
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// <p>The identifier of the shift activity that defines the type of time off being requested. This can be the ID or the ARN of the shift activity. It must be a time off activity. Activities that aren't set as <i>Requestable</i> are accepted.</p>
    pub fn shift_activity_id(&self) -> ::std::option::Option<&str> {
        self.shift_activity_id.as_deref()
    }
    /// <p>The start of the time off window, inclusive. It must be no earlier than one year before the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub fn start_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_at.as_ref()
    }
    /// <p>The end of the time off window, exclusive. It must be after <code>StartAt</code> and no later than 24 months after the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub fn end_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_at.as_ref()
    }
    /// <p>A description recorded on the time off request. If you omit it, the request has no description.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Controls who approves the request. <code>AWAIT_APPROVAL</code> waits for an <code>ApproveTimeOff</code> or <code>RejectTimeOff</code> call. <code>AUTOMATIC</code> has Connect Customer decide the request. For details, see <code>CreateTimeOff</code>.</p>
    pub fn approval_type(&self) -> ::std::option::Option<&crate::types::ApprovalType> {
        self.approval_type.as_ref()
    }
    /// <p>Controls what happens when a configured rule fails. <code>REJECT</code>, the default, records an <code>ERROR</code> and ends the request <code>REJECTED</code>, unless the whole window is in the past. <code>OVERRIDE</code> records a <code>WARNING</code> and ends the request <code>APPROVED</code>, like the <i>Override time off rules</i> option in the Connect Customer admin website. <code>OVERRIDE</code> requires <code>AUTOMATIC</code>. With <code>AWAIT_APPROVAL</code>, <code>OVERRIDE</code> fails with <code>ValidationException</code>. Set it on <code>ApproveTimeOff</code> instead. <code>OVERRIDE</code> never waives <code>CONFLICTING_TIME_OFF_REQUEST</code>.</p>
    pub fn rule_failure_action(&self) -> ::std::option::Option<&crate::types::RuleFailureAction> {
        self.rule_failure_action.as_ref()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If this token matches a previous request, Connect Customer returns the result of that request and doesn't create another time off request. If you don't provide a token, the AWS SDK populates this field. If you reuse a client token with a different request body, the request fails with <code>ValidationException</code>. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl ::std::fmt::Debug for CreateTimeOffInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateTimeOffInput");
        formatter.field("instance_id", &self.instance_id);
        formatter.field("user_id", &self.user_id);
        formatter.field("shift_activity_id", &self.shift_activity_id);
        formatter.field("start_at", &self.start_at);
        formatter.field("end_at", &self.end_at);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("approval_type", &self.approval_type);
        formatter.field("rule_failure_action", &self.rule_failure_action);
        formatter.field("client_token", &self.client_token);
        formatter.finish()
    }
}
impl CreateTimeOffInput {
    /// Creates a new builder-style object to manufacture [`CreateTimeOffInput`](crate::operation::create_time_off::CreateTimeOffInput).
    pub fn builder() -> crate::operation::create_time_off::builders::CreateTimeOffInputBuilder {
        crate::operation::create_time_off::builders::CreateTimeOffInputBuilder::default()
    }
}

/// A builder for [`CreateTimeOffInput`](crate::operation::create_time_off::CreateTimeOffInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateTimeOffInputBuilder {
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) shift_activity_id: ::std::option::Option<::std::string::String>,
    pub(crate) start_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) approval_type: ::std::option::Option<crate::types::ApprovalType>,
    pub(crate) rule_failure_action: ::std::option::Option<crate::types::RuleFailureAction>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateTimeOffInputBuilder {
    /// <p>The identifier of the Connect Customer instance. This can be the ID or the ARN of the instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    /// This field is required.
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the Connect Customer instance. This can be the ID or the ARN of the instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_id = input;
        self
    }
    /// <p>The identifier of the Connect Customer instance. This can be the ID or the ARN of the instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_id
    }
    /// <p>The identifier of the user who the time off request is for. This can be the ID or the ARN of the user.</p>
    /// This field is required.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the user who the time off request is for. This can be the ID or the ARN of the user.</p>
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// <p>The identifier of the user who the time off request is for. This can be the ID or the ARN of the user.</p>
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// <p>The identifier of the shift activity that defines the type of time off being requested. This can be the ID or the ARN of the shift activity. It must be a time off activity. Activities that aren't set as <i>Requestable</i> are accepted.</p>
    /// This field is required.
    pub fn shift_activity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.shift_activity_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the shift activity that defines the type of time off being requested. This can be the ID or the ARN of the shift activity. It must be a time off activity. Activities that aren't set as <i>Requestable</i> are accepted.</p>
    pub fn set_shift_activity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.shift_activity_id = input;
        self
    }
    /// <p>The identifier of the shift activity that defines the type of time off being requested. This can be the ID or the ARN of the shift activity. It must be a time off activity. Activities that aren't set as <i>Requestable</i> are accepted.</p>
    pub fn get_shift_activity_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.shift_activity_id
    }
    /// <p>The start of the time off window, inclusive. It must be no earlier than one year before the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    /// This field is required.
    pub fn start_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start of the time off window, inclusive. It must be no earlier than one year before the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub fn set_start_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_at = input;
        self
    }
    /// <p>The start of the time off window, inclusive. It must be no earlier than one year before the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub fn get_start_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_at
    }
    /// <p>The end of the time off window, exclusive. It must be after <code>StartAt</code> and no later than 24 months after the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    /// This field is required.
    pub fn end_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end of the time off window, exclusive. It must be after <code>StartAt</code> and no later than 24 months after the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub fn set_end_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_at = input;
        self
    }
    /// <p>The end of the time off window, exclusive. It must be after <code>StartAt</code> and no later than 24 months after the current date. Connect Customer stores the value as sent, to the millisecond.</p>
    pub fn get_end_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_at
    }
    /// <p>A description recorded on the time off request. If you omit it, the request has no description.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description recorded on the time off request. If you omit it, the request has no description.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description recorded on the time off request. If you omit it, the request has no description.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>Controls who approves the request. <code>AWAIT_APPROVAL</code> waits for an <code>ApproveTimeOff</code> or <code>RejectTimeOff</code> call. <code>AUTOMATIC</code> has Connect Customer decide the request. For details, see <code>CreateTimeOff</code>.</p>
    /// This field is required.
    pub fn approval_type(mut self, input: crate::types::ApprovalType) -> Self {
        self.approval_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Controls who approves the request. <code>AWAIT_APPROVAL</code> waits for an <code>ApproveTimeOff</code> or <code>RejectTimeOff</code> call. <code>AUTOMATIC</code> has Connect Customer decide the request. For details, see <code>CreateTimeOff</code>.</p>
    pub fn set_approval_type(mut self, input: ::std::option::Option<crate::types::ApprovalType>) -> Self {
        self.approval_type = input;
        self
    }
    /// <p>Controls who approves the request. <code>AWAIT_APPROVAL</code> waits for an <code>ApproveTimeOff</code> or <code>RejectTimeOff</code> call. <code>AUTOMATIC</code> has Connect Customer decide the request. For details, see <code>CreateTimeOff</code>.</p>
    pub fn get_approval_type(&self) -> &::std::option::Option<crate::types::ApprovalType> {
        &self.approval_type
    }
    /// <p>Controls what happens when a configured rule fails. <code>REJECT</code>, the default, records an <code>ERROR</code> and ends the request <code>REJECTED</code>, unless the whole window is in the past. <code>OVERRIDE</code> records a <code>WARNING</code> and ends the request <code>APPROVED</code>, like the <i>Override time off rules</i> option in the Connect Customer admin website. <code>OVERRIDE</code> requires <code>AUTOMATIC</code>. With <code>AWAIT_APPROVAL</code>, <code>OVERRIDE</code> fails with <code>ValidationException</code>. Set it on <code>ApproveTimeOff</code> instead. <code>OVERRIDE</code> never waives <code>CONFLICTING_TIME_OFF_REQUEST</code>.</p>
    pub fn rule_failure_action(mut self, input: crate::types::RuleFailureAction) -> Self {
        self.rule_failure_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>Controls what happens when a configured rule fails. <code>REJECT</code>, the default, records an <code>ERROR</code> and ends the request <code>REJECTED</code>, unless the whole window is in the past. <code>OVERRIDE</code> records a <code>WARNING</code> and ends the request <code>APPROVED</code>, like the <i>Override time off rules</i> option in the Connect Customer admin website. <code>OVERRIDE</code> requires <code>AUTOMATIC</code>. With <code>AWAIT_APPROVAL</code>, <code>OVERRIDE</code> fails with <code>ValidationException</code>. Set it on <code>ApproveTimeOff</code> instead. <code>OVERRIDE</code> never waives <code>CONFLICTING_TIME_OFF_REQUEST</code>.</p>
    pub fn set_rule_failure_action(mut self, input: ::std::option::Option<crate::types::RuleFailureAction>) -> Self {
        self.rule_failure_action = input;
        self
    }
    /// <p>Controls what happens when a configured rule fails. <code>REJECT</code>, the default, records an <code>ERROR</code> and ends the request <code>REJECTED</code>, unless the whole window is in the past. <code>OVERRIDE</code> records a <code>WARNING</code> and ends the request <code>APPROVED</code>, like the <i>Override time off rules</i> option in the Connect Customer admin website. <code>OVERRIDE</code> requires <code>AUTOMATIC</code>. With <code>AWAIT_APPROVAL</code>, <code>OVERRIDE</code> fails with <code>ValidationException</code>. Set it on <code>ApproveTimeOff</code> instead. <code>OVERRIDE</code> never waives <code>CONFLICTING_TIME_OFF_REQUEST</code>.</p>
    pub fn get_rule_failure_action(&self) -> &::std::option::Option<crate::types::RuleFailureAction> {
        &self.rule_failure_action
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If this token matches a previous request, Connect Customer returns the result of that request and doesn't create another time off request. If you don't provide a token, the AWS SDK populates this field. If you reuse a client token with a different request body, the request fails with <code>ValidationException</code>. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If this token matches a previous request, Connect Customer returns the result of that request and doesn't create another time off request. If you don't provide a token, the AWS SDK populates this field. If you reuse a client token with a different request body, the request fails with <code>ValidationException</code>. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If this token matches a previous request, Connect Customer returns the result of that request and doesn't create another time off request. If you don't provide a token, the AWS SDK populates this field. If you reuse a client token with a different request body, the request fails with <code>ValidationException</code>. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateTimeOffInput`](crate::operation::create_time_off::CreateTimeOffInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_time_off::CreateTimeOffInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_time_off::CreateTimeOffInput {
            instance_id: self.instance_id,
            user_id: self.user_id,
            shift_activity_id: self.shift_activity_id,
            start_at: self.start_at,
            end_at: self.end_at,
            description: self.description,
            approval_type: self.approval_type,
            rule_failure_action: self.rule_failure_action,
            client_token: self.client_token,
        })
    }
}
impl ::std::fmt::Debug for CreateTimeOffInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateTimeOffInputBuilder");
        formatter.field("instance_id", &self.instance_id);
        formatter.field("user_id", &self.user_id);
        formatter.field("shift_activity_id", &self.shift_activity_id);
        formatter.field("start_at", &self.start_at);
        formatter.field("end_at", &self.end_at);
        formatter.field("description", &"*** Sensitive Data Redacted ***");
        formatter.field("approval_type", &self.approval_type);
        formatter.field("rule_failure_action", &self.rule_failure_action);
        formatter.field("client_token", &self.client_token);
        formatter.finish()
    }
}