
software.amazon.awssdk.services.grafana.model.WorkspaceDescription Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.grafana.model;
import java.beans.Transient;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* A structure containing information about an Amazon Managed Grafana workspace in your account.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class WorkspaceDescription implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACCOUNT_ACCESS_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("accountAccessType").getter(getter(WorkspaceDescription::accountAccessTypeAsString))
.setter(setter(Builder::accountAccessType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("accountAccessType").build()).build();
private static final SdkField AUTHENTICATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("authentication")
.getter(getter(WorkspaceDescription::authentication)).setter(setter(Builder::authentication))
.constructor(AuthenticationSummary::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authentication").build()).build();
private static final SdkField CREATED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("created").getter(getter(WorkspaceDescription::created)).setter(setter(Builder::created))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("created").build()).build();
private static final SdkField> DATA_SOURCES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("dataSources")
.getter(getter(WorkspaceDescription::dataSourcesAsStrings))
.setter(setter(Builder::dataSourcesWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataSources").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(WorkspaceDescription::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("endpoint").getter(getter(WorkspaceDescription::endpoint)).setter(setter(Builder::endpoint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("endpoint").build()).build();
private static final SdkField FREE_TRIAL_CONSUMED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("freeTrialConsumed").getter(getter(WorkspaceDescription::freeTrialConsumed))
.setter(setter(Builder::freeTrialConsumed))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("freeTrialConsumed").build()).build();
private static final SdkField FREE_TRIAL_EXPIRATION_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("freeTrialExpiration").getter(getter(WorkspaceDescription::freeTrialExpiration))
.setter(setter(Builder::freeTrialExpiration))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("freeTrialExpiration").build())
.build();
private static final SdkField GRAFANA_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("grafanaVersion").getter(getter(WorkspaceDescription::grafanaVersion))
.setter(setter(Builder::grafanaVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("grafanaVersion").build()).build();
private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("id")
.getter(getter(WorkspaceDescription::id)).setter(setter(Builder::id))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("id").build()).build();
private static final SdkField LICENSE_EXPIRATION_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("licenseExpiration").getter(getter(WorkspaceDescription::licenseExpiration))
.setter(setter(Builder::licenseExpiration))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("licenseExpiration").build()).build();
private static final SdkField LICENSE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("licenseType").getter(getter(WorkspaceDescription::licenseTypeAsString))
.setter(setter(Builder::licenseType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("licenseType").build()).build();
private static final SdkField MODIFIED_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("modified").getter(getter(WorkspaceDescription::modified)).setter(setter(Builder::modified))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("modified").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(WorkspaceDescription::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField> NOTIFICATION_DESTINATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("notificationDestinations")
.getter(getter(WorkspaceDescription::notificationDestinationsAsStrings))
.setter(setter(Builder::notificationDestinationsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("notificationDestinations").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField ORGANIZATION_ROLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("organizationRoleName").getter(getter(WorkspaceDescription::organizationRoleName))
.setter(setter(Builder::organizationRoleName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("organizationRoleName").build())
.build();
private static final SdkField> ORGANIZATIONAL_UNITS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("organizationalUnits")
.getter(getter(WorkspaceDescription::organizationalUnits))
.setter(setter(Builder::organizationalUnits))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("organizationalUnits").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField PERMISSION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("permissionType").getter(getter(WorkspaceDescription::permissionTypeAsString))
.setter(setter(Builder::permissionType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("permissionType").build()).build();
private static final SdkField STACK_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("stackSetName").getter(getter(WorkspaceDescription::stackSetName)).setter(setter(Builder::stackSetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stackSetName").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(WorkspaceDescription::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField WORKSPACE_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("workspaceRoleArn").getter(getter(WorkspaceDescription::workspaceRoleArn))
.setter(setter(Builder::workspaceRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("workspaceRoleArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_ACCESS_TYPE_FIELD,
AUTHENTICATION_FIELD, CREATED_FIELD, DATA_SOURCES_FIELD, DESCRIPTION_FIELD, ENDPOINT_FIELD,
FREE_TRIAL_CONSUMED_FIELD, FREE_TRIAL_EXPIRATION_FIELD, GRAFANA_VERSION_FIELD, ID_FIELD, LICENSE_EXPIRATION_FIELD,
LICENSE_TYPE_FIELD, MODIFIED_FIELD, NAME_FIELD, NOTIFICATION_DESTINATIONS_FIELD, ORGANIZATION_ROLE_NAME_FIELD,
ORGANIZATIONAL_UNITS_FIELD, PERMISSION_TYPE_FIELD, STACK_SET_NAME_FIELD, STATUS_FIELD, WORKSPACE_ROLE_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final String accountAccessType;
private final AuthenticationSummary authentication;
private final Instant created;
private final List dataSources;
private final String description;
private final String endpoint;
private final Boolean freeTrialConsumed;
private final Instant freeTrialExpiration;
private final String grafanaVersion;
private final String id;
private final Instant licenseExpiration;
private final String licenseType;
private final Instant modified;
private final String name;
private final List notificationDestinations;
private final String organizationRoleName;
private final List organizationalUnits;
private final String permissionType;
private final String stackSetName;
private final String status;
private final String workspaceRoleArn;
private WorkspaceDescription(BuilderImpl builder) {
this.accountAccessType = builder.accountAccessType;
this.authentication = builder.authentication;
this.created = builder.created;
this.dataSources = builder.dataSources;
this.description = builder.description;
this.endpoint = builder.endpoint;
this.freeTrialConsumed = builder.freeTrialConsumed;
this.freeTrialExpiration = builder.freeTrialExpiration;
this.grafanaVersion = builder.grafanaVersion;
this.id = builder.id;
this.licenseExpiration = builder.licenseExpiration;
this.licenseType = builder.licenseType;
this.modified = builder.modified;
this.name = builder.name;
this.notificationDestinations = builder.notificationDestinations;
this.organizationRoleName = builder.organizationRoleName;
this.organizationalUnits = builder.organizationalUnits;
this.permissionType = builder.permissionType;
this.stackSetName = builder.stackSetName;
this.status = builder.status;
this.workspaceRoleArn = builder.workspaceRoleArn;
}
/**
*
* Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services account
* only, or whether it can also access Amazon Web Services resources in other accounts in the same organization. If
* this is ORGANIZATION
, the workspaceOrganizationalUnits
parameter specifies which
* organizational units the workspace can access.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #accountAccessType}
* will return {@link AccountAccessType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #accountAccessTypeAsString}.
*
*
* @return Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services
* account only, or whether it can also access Amazon Web Services resources in other accounts in the same
* organization. If this is ORGANIZATION
, the workspaceOrganizationalUnits
* parameter specifies which organizational units the workspace can access.
* @see AccountAccessType
*/
public final AccountAccessType accountAccessType() {
return AccountAccessType.fromValue(accountAccessType);
}
/**
*
* Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services account
* only, or whether it can also access Amazon Web Services resources in other accounts in the same organization. If
* this is ORGANIZATION
, the workspaceOrganizationalUnits
parameter specifies which
* organizational units the workspace can access.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #accountAccessType}
* will return {@link AccountAccessType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #accountAccessTypeAsString}.
*
*
* @return Specifies whether the workspace can access Amazon Web Services resources in this Amazon Web Services
* account only, or whether it can also access Amazon Web Services resources in other accounts in the same
* organization. If this is ORGANIZATION
, the workspaceOrganizationalUnits
* parameter specifies which organizational units the workspace can access.
* @see AccountAccessType
*/
public final String accountAccessTypeAsString() {
return accountAccessType;
}
/**
*
* A structure that describes whether the workspace uses SAML, Amazon Web Services SSO, or both methods for user
* authentication.
*
*
* @return A structure that describes whether the workspace uses SAML, Amazon Web Services SSO, or both methods for
* user authentication.
*/
public final AuthenticationSummary authentication() {
return authentication;
}
/**
*
* The date that the workspace was created.
*
*
* @return The date that the workspace was created.
*/
public final Instant created() {
return created;
}
/**
*
* Specifies the Amazon Web Services data sources that have been configured to have IAM roles and permissions
* created to allow Amazon Managed Grafana to read data from these sources.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasDataSources} method.
*
*
* @return Specifies the Amazon Web Services data sources that have been configured to have IAM roles and
* permissions created to allow Amazon Managed Grafana to read data from these sources.
*/
public final List dataSources() {
return DataSourceTypesListCopier.copyStringToEnum(dataSources);
}
/**
* For responses, this returns true if the service returned a value for the DataSources property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasDataSources() {
return dataSources != null && !(dataSources instanceof SdkAutoConstructList);
}
/**
*
* Specifies the Amazon Web Services data sources that have been configured to have IAM roles and permissions
* created to allow Amazon Managed Grafana to read data from these sources.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasDataSources} method.
*
*
* @return Specifies the Amazon Web Services data sources that have been configured to have IAM roles and
* permissions created to allow Amazon Managed Grafana to read data from these sources.
*/
public final List dataSourcesAsStrings() {
return dataSources;
}
/**
*
* The user-defined description of the workspace.
*
*
* @return The user-defined description of the workspace.
*/
public final String description() {
return description;
}
/**
*
* The URL that users can use to access the Grafana console in the workspace.
*
*
* @return The URL that users can use to access the Grafana console in the workspace.
*/
public final String endpoint() {
return endpoint;
}
/**
*
* Specifies whether this workspace has already fully used its free trial for Grafana Enterprise.
*
*
* @return Specifies whether this workspace has already fully used its free trial for Grafana Enterprise.
*/
public final Boolean freeTrialConsumed() {
return freeTrialConsumed;
}
/**
*
* If this workspace is currently in the free trial period for Grafana Enterprise, this value specifies when that
* free trial ends.
*
*
* @return If this workspace is currently in the free trial period for Grafana Enterprise, this value specifies when
* that free trial ends.
*/
public final Instant freeTrialExpiration() {
return freeTrialExpiration;
}
/**
*
* The version of Grafana supported in this workspace.
*
*
* @return The version of Grafana supported in this workspace.
*/
public final String grafanaVersion() {
return grafanaVersion;
}
/**
*
* The unique ID of this workspace.
*
*
* @return The unique ID of this workspace.
*/
public final String id() {
return id;
}
/**
*
* If this workspace has a full Grafana Enterprise license, this specifies when the license ends and will need to be
* renewed.
*
*
* @return If this workspace has a full Grafana Enterprise license, this specifies when the license ends and will
* need to be renewed.
*/
public final Instant licenseExpiration() {
return licenseExpiration;
}
/**
*
* Specifies whether this workspace has a full Grafana Enterprise license or a free trial license.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #licenseType} will
* return {@link LicenseType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #licenseTypeAsString}.
*
*
* @return Specifies whether this workspace has a full Grafana Enterprise license or a free trial license.
* @see LicenseType
*/
public final LicenseType licenseType() {
return LicenseType.fromValue(licenseType);
}
/**
*
* Specifies whether this workspace has a full Grafana Enterprise license or a free trial license.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #licenseType} will
* return {@link LicenseType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #licenseTypeAsString}.
*
*
* @return Specifies whether this workspace has a full Grafana Enterprise license or a free trial license.
* @see LicenseType
*/
public final String licenseTypeAsString() {
return licenseType;
}
/**
*
* The most recent date that the workspace was modified.
*
*
* @return The most recent date that the workspace was modified.
*/
public final Instant modified() {
return modified;
}
/**
*
* The name of the workspace.
*
*
* @return The name of the workspace.
*/
public final String name() {
return name;
}
/**
*
* The Amazon Web Services notification channels that Amazon Managed Grafana can automatically create IAM roles and
* permissions for, to allow Amazon Managed Grafana to use these channels.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasNotificationDestinations} method.
*
*
* @return The Amazon Web Services notification channels that Amazon Managed Grafana can automatically create IAM
* roles and permissions for, to allow Amazon Managed Grafana to use these channels.
*/
public final List notificationDestinations() {
return NotificationDestinationsListCopier.copyStringToEnum(notificationDestinations);
}
/**
* For responses, this returns true if the service returned a value for the NotificationDestinations property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasNotificationDestinations() {
return notificationDestinations != null && !(notificationDestinations instanceof SdkAutoConstructList);
}
/**
*
* The Amazon Web Services notification channels that Amazon Managed Grafana can automatically create IAM roles and
* permissions for, to allow Amazon Managed Grafana to use these channels.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasNotificationDestinations} method.
*
*
* @return The Amazon Web Services notification channels that Amazon Managed Grafana can automatically create IAM
* roles and permissions for, to allow Amazon Managed Grafana to use these channels.
*/
public final List notificationDestinationsAsStrings() {
return notificationDestinations;
}
/**
*
* The name of the IAM role that is used to access resources through Organizations.
*
*
* @return The name of the IAM role that is used to access resources through Organizations.
*/
public final String organizationRoleName() {
return organizationRoleName;
}
/**
* For responses, this returns true if the service returned a value for the OrganizationalUnits property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasOrganizationalUnits() {
return organizationalUnits != null && !(organizationalUnits instanceof SdkAutoConstructList);
}
/**
*
* Specifies the organizational units that this workspace is allowed to use data sources from, if this workspace is
* in an account that is part of an organization.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasOrganizationalUnits} method.
*
*
* @return Specifies the organizational units that this workspace is allowed to use data sources from, if this
* workspace is in an account that is part of an organization.
*/
public final List organizationalUnits() {
return organizationalUnits;
}
/**
*
* If this is Service Managed
, Amazon Managed Grafana automatically creates the IAM roles and
* provisions the permissions that the workspace needs to use Amazon Web Services data sources and notification
* channels.
*
*
* If this is CUSTOMER_MANAGED
, you manage those roles and permissions yourself. If you are creating
* this workspace in a member account of an organization and that account is not a delegated administrator account,
* and you want the workspace to access data sources in other Amazon Web Services accounts in the organization, you
* must choose CUSTOMER_MANAGED
.
*
*
* For more information, see Amazon Managed Grafana
* permissions and policies for Amazon Web Services data sources and notification channels
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #permissionType}
* will return {@link PermissionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #permissionTypeAsString}.
*
*
* @return If this is Service Managed
, Amazon Managed Grafana automatically creates the IAM roles and
* provisions the permissions that the workspace needs to use Amazon Web Services data sources and
* notification channels.
*
* If this is CUSTOMER_MANAGED
, you manage those roles and permissions yourself. If you are
* creating this workspace in a member account of an organization and that account is not a delegated
* administrator account, and you want the workspace to access data sources in other Amazon Web Services
* accounts in the organization, you must choose CUSTOMER_MANAGED
.
*
*
* For more information, see Amazon Managed
* Grafana permissions and policies for Amazon Web Services data sources and notification channels
* @see PermissionType
*/
public final PermissionType permissionType() {
return PermissionType.fromValue(permissionType);
}
/**
*
* If this is Service Managed
, Amazon Managed Grafana automatically creates the IAM roles and
* provisions the permissions that the workspace needs to use Amazon Web Services data sources and notification
* channels.
*
*
* If this is CUSTOMER_MANAGED
, you manage those roles and permissions yourself. If you are creating
* this workspace in a member account of an organization and that account is not a delegated administrator account,
* and you want the workspace to access data sources in other Amazon Web Services accounts in the organization, you
* must choose CUSTOMER_MANAGED
.
*
*
* For more information, see Amazon Managed Grafana
* permissions and policies for Amazon Web Services data sources and notification channels
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #permissionType}
* will return {@link PermissionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #permissionTypeAsString}.
*
*
* @return If this is Service Managed
, Amazon Managed Grafana automatically creates the IAM roles and
* provisions the permissions that the workspace needs to use Amazon Web Services data sources and
* notification channels.
*
* If this is CUSTOMER_MANAGED
, you manage those roles and permissions yourself. If you are
* creating this workspace in a member account of an organization and that account is not a delegated
* administrator account, and you want the workspace to access data sources in other Amazon Web Services
* accounts in the organization, you must choose CUSTOMER_MANAGED
.
*
*
* For more information, see Amazon Managed
* Grafana permissions and policies for Amazon Web Services data sources and notification channels
* @see PermissionType
*/
public final String permissionTypeAsString() {
return permissionType;
}
/**
*
* The name of the CloudFormation stack set that is used to generate IAM roles to be used for this workspace.
*
*
* @return The name of the CloudFormation stack set that is used to generate IAM roles to be used for this
* workspace.
*/
public final String stackSetName() {
return stackSetName;
}
/**
*
* The current status of the workspace.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link WorkspaceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of the workspace.
* @see WorkspaceStatus
*/
public final WorkspaceStatus status() {
return WorkspaceStatus.fromValue(status);
}
/**
*
* The current status of the workspace.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link WorkspaceStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The current status of the workspace.
* @see WorkspaceStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The IAM role that grants permissions to the Amazon Web Services resources that the workspace will view data from.
* This role must already exist.
*
*
* @return The IAM role that grants permissions to the Amazon Web Services resources that the workspace will view
* data from. This role must already exist.
*/
public final String workspaceRoleArn() {
return workspaceRoleArn;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(accountAccessTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(authentication());
hashCode = 31 * hashCode + Objects.hashCode(created());
hashCode = 31 * hashCode + Objects.hashCode(hasDataSources() ? dataSourcesAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(endpoint());
hashCode = 31 * hashCode + Objects.hashCode(freeTrialConsumed());
hashCode = 31 * hashCode + Objects.hashCode(freeTrialExpiration());
hashCode = 31 * hashCode + Objects.hashCode(grafanaVersion());
hashCode = 31 * hashCode + Objects.hashCode(id());
hashCode = 31 * hashCode + Objects.hashCode(licenseExpiration());
hashCode = 31 * hashCode + Objects.hashCode(licenseTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(modified());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(hasNotificationDestinations() ? notificationDestinationsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(organizationRoleName());
hashCode = 31 * hashCode + Objects.hashCode(hasOrganizationalUnits() ? organizationalUnits() : null);
hashCode = 31 * hashCode + Objects.hashCode(permissionTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(stackSetName());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(workspaceRoleArn());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof WorkspaceDescription)) {
return false;
}
WorkspaceDescription other = (WorkspaceDescription) obj;
return Objects.equals(accountAccessTypeAsString(), other.accountAccessTypeAsString())
&& Objects.equals(authentication(), other.authentication()) && Objects.equals(created(), other.created())
&& hasDataSources() == other.hasDataSources()
&& Objects.equals(dataSourcesAsStrings(), other.dataSourcesAsStrings())
&& Objects.equals(description(), other.description()) && Objects.equals(endpoint(), other.endpoint())
&& Objects.equals(freeTrialConsumed(), other.freeTrialConsumed())
&& Objects.equals(freeTrialExpiration(), other.freeTrialExpiration())
&& Objects.equals(grafanaVersion(), other.grafanaVersion()) && Objects.equals(id(), other.id())
&& Objects.equals(licenseExpiration(), other.licenseExpiration())
&& Objects.equals(licenseTypeAsString(), other.licenseTypeAsString())
&& Objects.equals(modified(), other.modified()) && Objects.equals(name(), other.name())
&& hasNotificationDestinations() == other.hasNotificationDestinations()
&& Objects.equals(notificationDestinationsAsStrings(), other.notificationDestinationsAsStrings())
&& Objects.equals(organizationRoleName(), other.organizationRoleName())
&& hasOrganizationalUnits() == other.hasOrganizationalUnits()
&& Objects.equals(organizationalUnits(), other.organizationalUnits())
&& Objects.equals(permissionTypeAsString(), other.permissionTypeAsString())
&& Objects.equals(stackSetName(), other.stackSetName())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(workspaceRoleArn(), other.workspaceRoleArn());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("WorkspaceDescription").add("AccountAccessType", accountAccessTypeAsString())
.add("Authentication", authentication()).add("Created", created())
.add("DataSources", hasDataSources() ? dataSourcesAsStrings() : null)
.add("Description", description() == null ? null : "*** Sensitive Data Redacted ***").add("Endpoint", endpoint())
.add("FreeTrialConsumed", freeTrialConsumed()).add("FreeTrialExpiration", freeTrialExpiration())
.add("GrafanaVersion", grafanaVersion()).add("Id", id()).add("LicenseExpiration", licenseExpiration())
.add("LicenseType", licenseTypeAsString()).add("Modified", modified())
.add("Name", name() == null ? null : "*** Sensitive Data Redacted ***")
.add("NotificationDestinations", hasNotificationDestinations() ? notificationDestinationsAsStrings() : null)
.add("OrganizationRoleName", organizationRoleName() == null ? null : "*** Sensitive Data Redacted ***")
.add("OrganizationalUnits", organizationalUnits() == null ? null : "*** Sensitive Data Redacted ***")
.add("PermissionType", permissionTypeAsString()).add("StackSetName", stackSetName())
.add("Status", statusAsString())
.add("WorkspaceRoleArn", workspaceRoleArn() == null ? null : "*** Sensitive Data Redacted ***").build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "accountAccessType":
return Optional.ofNullable(clazz.cast(accountAccessTypeAsString()));
case "authentication":
return Optional.ofNullable(clazz.cast(authentication()));
case "created":
return Optional.ofNullable(clazz.cast(created()));
case "dataSources":
return Optional.ofNullable(clazz.cast(dataSourcesAsStrings()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "endpoint":
return Optional.ofNullable(clazz.cast(endpoint()));
case "freeTrialConsumed":
return Optional.ofNullable(clazz.cast(freeTrialConsumed()));
case "freeTrialExpiration":
return Optional.ofNullable(clazz.cast(freeTrialExpiration()));
case "grafanaVersion":
return Optional.ofNullable(clazz.cast(grafanaVersion()));
case "id":
return Optional.ofNullable(clazz.cast(id()));
case "licenseExpiration":
return Optional.ofNullable(clazz.cast(licenseExpiration()));
case "licenseType":
return Optional.ofNullable(clazz.cast(licenseTypeAsString()));
case "modified":
return Optional.ofNullable(clazz.cast(modified()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "notificationDestinations":
return Optional.ofNullable(clazz.cast(notificationDestinationsAsStrings()));
case "organizationRoleName":
return Optional.ofNullable(clazz.cast(organizationRoleName()));
case "organizationalUnits":
return Optional.ofNullable(clazz.cast(organizationalUnits()));
case "permissionType":
return Optional.ofNullable(clazz.cast(permissionTypeAsString()));
case "stackSetName":
return Optional.ofNullable(clazz.cast(stackSetName()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "workspaceRoleArn":
return Optional.ofNullable(clazz.cast(workspaceRoleArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function