aws_sdk_grafana/operation/associate_license/
_associate_license_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct AssociateLicenseInput {
6    /// <p>The ID of the workspace to associate the license with.</p>
7    pub workspace_id: ::std::option::Option<::std::string::String>,
8    /// <p>The type of license to associate with the workspace.</p><note>
9    /// <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
10    /// </note>
11    pub license_type: ::std::option::Option<crate::types::LicenseType>,
12    /// <p>A token from Grafana Labs that ties your Amazon Web Services account with a Grafana Labs account. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Link your account with Grafana Labs</a>.</p>
13    pub grafana_token: ::std::option::Option<::std::string::String>,
14}
15impl AssociateLicenseInput {
16    /// <p>The ID of the workspace to associate the license with.</p>
17    pub fn workspace_id(&self) -> ::std::option::Option<&str> {
18        self.workspace_id.as_deref()
19    }
20    /// <p>The type of license to associate with the workspace.</p><note>
21    /// <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
22    /// </note>
23    pub fn license_type(&self) -> ::std::option::Option<&crate::types::LicenseType> {
24        self.license_type.as_ref()
25    }
26    /// <p>A token from Grafana Labs that ties your Amazon Web Services account with a Grafana Labs account. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Link your account with Grafana Labs</a>.</p>
27    pub fn grafana_token(&self) -> ::std::option::Option<&str> {
28        self.grafana_token.as_deref()
29    }
30}
31impl AssociateLicenseInput {
32    /// Creates a new builder-style object to manufacture [`AssociateLicenseInput`](crate::operation::associate_license::AssociateLicenseInput).
33    pub fn builder() -> crate::operation::associate_license::builders::AssociateLicenseInputBuilder {
34        crate::operation::associate_license::builders::AssociateLicenseInputBuilder::default()
35    }
36}
37
38/// A builder for [`AssociateLicenseInput`](crate::operation::associate_license::AssociateLicenseInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct AssociateLicenseInputBuilder {
42    pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
43    pub(crate) license_type: ::std::option::Option<crate::types::LicenseType>,
44    pub(crate) grafana_token: ::std::option::Option<::std::string::String>,
45}
46impl AssociateLicenseInputBuilder {
47    /// <p>The ID of the workspace to associate the license with.</p>
48    /// This field is required.
49    pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.workspace_id = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The ID of the workspace to associate the license with.</p>
54    pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.workspace_id = input;
56        self
57    }
58    /// <p>The ID of the workspace to associate the license with.</p>
59    pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
60        &self.workspace_id
61    }
62    /// <p>The type of license to associate with the workspace.</p><note>
63    /// <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
64    /// </note>
65    /// This field is required.
66    pub fn license_type(mut self, input: crate::types::LicenseType) -> Self {
67        self.license_type = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The type of license to associate with the workspace.</p><note>
71    /// <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
72    /// </note>
73    pub fn set_license_type(mut self, input: ::std::option::Option<crate::types::LicenseType>) -> Self {
74        self.license_type = input;
75        self
76    }
77    /// <p>The type of license to associate with the workspace.</p><note>
78    /// <p>Amazon Managed Grafana workspaces no longer support Grafana Enterprise free trials.</p>
79    /// </note>
80    pub fn get_license_type(&self) -> &::std::option::Option<crate::types::LicenseType> {
81        &self.license_type
82    }
83    /// <p>A token from Grafana Labs that ties your Amazon Web Services account with a Grafana Labs account. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Link your account with Grafana Labs</a>.</p>
84    pub fn grafana_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.grafana_token = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>A token from Grafana Labs that ties your Amazon Web Services account with a Grafana Labs account. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Link your account with Grafana Labs</a>.</p>
89    pub fn set_grafana_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.grafana_token = input;
91        self
92    }
93    /// <p>A token from Grafana Labs that ties your Amazon Web Services account with a Grafana Labs account. For more information, see <a href="https://docs.aws.amazon.com/grafana/latest/userguide/upgrade-to-Grafana-Enterprise.html#AMG-workspace-register-enterprise">Link your account with Grafana Labs</a>.</p>
94    pub fn get_grafana_token(&self) -> &::std::option::Option<::std::string::String> {
95        &self.grafana_token
96    }
97    /// Consumes the builder and constructs a [`AssociateLicenseInput`](crate::operation::associate_license::AssociateLicenseInput).
98    pub fn build(
99        self,
100    ) -> ::std::result::Result<crate::operation::associate_license::AssociateLicenseInput, ::aws_smithy_types::error::operation::BuildError> {
101        ::std::result::Result::Ok(crate::operation::associate_license::AssociateLicenseInput {
102            workspace_id: self.workspace_id,
103            license_type: self.license_type,
104            grafana_token: self.grafana_token,
105        })
106    }
107}