All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cloudshiftdev.awscdk.services.ssm.ListParameterAttributes.kt Maven / Gradle / Ivy

The newest version!
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")

package io.cloudshiftdev.awscdk.services.ssm

import io.cloudshiftdev.awscdk.common.CdkDslMarker
import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import kotlin.Boolean
import kotlin.Number
import kotlin.String
import kotlin.Unit

/**
 * Attributes for parameters of string list type.
 *
 * Example:
 *
 * ```
 * // The code below shows an example of how to instantiate this type.
 * // The values are placeholders you should change.
 * import io.cloudshiftdev.awscdk.services.ssm.*;
 * ListParameterAttributes listParameterAttributes = ListParameterAttributes.builder()
 * .parameterName("parameterName")
 * // the properties below are optional
 * .elementType(ParameterValueType.STRING)
 * .simpleName(false)
 * .version(123)
 * .build();
 * ```
 *
 * [Documentation](ParameterType)
 */
public interface ListParameterAttributes : CommonStringParameterAttributes {
  /**
   * The type of the string list parameter value.
   *
   * Using specific types can be helpful in catching invalid values
   * at the start of creating or updating a stack. CloudFormation validates
   * the values against existing values in the account.
   *
   * Note - if you want to allow values from different AWS accounts, use
   * ParameterValueType.STRING
   *
   * Default: ParameterValueType.STRING
   *
   * [Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types)
   */
  public fun elementType(): ParameterValueType? =
      unwrap(this).getElementType()?.let(ParameterValueType::wrap)

  /**
   * The version number of the value you wish to retrieve.
   *
   * Default: The latest version will be retrieved.
   */
  public fun version(): Number? = unwrap(this).getVersion()

  /**
   * A builder for [ListParameterAttributes]
   */
  @CdkDslMarker
  public interface Builder {
    /**
     * @param elementType The type of the string list parameter value.
     * Using specific types can be helpful in catching invalid values
     * at the start of creating or updating a stack. CloudFormation validates
     * the values against existing values in the account.
     *
     * Note - if you want to allow values from different AWS accounts, use
     * ParameterValueType.STRING
     */
    public fun elementType(elementType: ParameterValueType)

    /**
     * @param parameterName The name of the parameter store value. 
     * This value can be a token or a concrete string. If it is a concrete string
     * and includes "/" it must also be prefixed with a "/" (fully-qualified).
     */
    public fun parameterName(parameterName: String)

    /**
     * @param simpleName Indicates whether the parameter name is a simple name.
     * A parameter name
     * without any "/" is considered a simple name. If the parameter name includes
     * "/", setting simpleName to true might cause unintended issues such
     * as duplicate "/" in the resulting ARN.
     *
     * This is required only if `parameterName` is a token, which means we
     * are unable to detect if the name is simple or "path-like" for the purpose
     * of rendering SSM parameter ARNs.
     *
     * If `parameterName` is not specified, `simpleName` must be `true` (or
     * undefined) since the name generated by AWS CloudFormation is always a
     * simple name.
     */
    public fun simpleName(simpleName: Boolean)

    /**
     * @param version The version number of the value you wish to retrieve.
     */
    public fun version(version: Number)
  }

  private class BuilderImpl : Builder {
    private val cdkBuilder: software.amazon.awscdk.services.ssm.ListParameterAttributes.Builder =
        software.amazon.awscdk.services.ssm.ListParameterAttributes.builder()

    /**
     * @param elementType The type of the string list parameter value.
     * Using specific types can be helpful in catching invalid values
     * at the start of creating or updating a stack. CloudFormation validates
     * the values against existing values in the account.
     *
     * Note - if you want to allow values from different AWS accounts, use
     * ParameterValueType.STRING
     */
    override fun elementType(elementType: ParameterValueType) {
      cdkBuilder.elementType(elementType.let(ParameterValueType.Companion::unwrap))
    }

    /**
     * @param parameterName The name of the parameter store value. 
     * This value can be a token or a concrete string. If it is a concrete string
     * and includes "/" it must also be prefixed with a "/" (fully-qualified).
     */
    override fun parameterName(parameterName: String) {
      cdkBuilder.parameterName(parameterName)
    }

    /**
     * @param simpleName Indicates whether the parameter name is a simple name.
     * A parameter name
     * without any "/" is considered a simple name. If the parameter name includes
     * "/", setting simpleName to true might cause unintended issues such
     * as duplicate "/" in the resulting ARN.
     *
     * This is required only if `parameterName` is a token, which means we
     * are unable to detect if the name is simple or "path-like" for the purpose
     * of rendering SSM parameter ARNs.
     *
     * If `parameterName` is not specified, `simpleName` must be `true` (or
     * undefined) since the name generated by AWS CloudFormation is always a
     * simple name.
     */
    override fun simpleName(simpleName: Boolean) {
      cdkBuilder.simpleName(simpleName)
    }

    /**
     * @param version The version number of the value you wish to retrieve.
     */
    override fun version(version: Number) {
      cdkBuilder.version(version)
    }

    public fun build(): software.amazon.awscdk.services.ssm.ListParameterAttributes =
        cdkBuilder.build()
  }

  private class Wrapper(
    cdkObject: software.amazon.awscdk.services.ssm.ListParameterAttributes,
  ) : CdkObject(cdkObject),
      ListParameterAttributes {
    /**
     * The type of the string list parameter value.
     *
     * Using specific types can be helpful in catching invalid values
     * at the start of creating or updating a stack. CloudFormation validates
     * the values against existing values in the account.
     *
     * Note - if you want to allow values from different AWS accounts, use
     * ParameterValueType.STRING
     *
     * Default: ParameterValueType.STRING
     *
     * [Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html#aws-ssm-parameter-types)
     */
    override fun elementType(): ParameterValueType? =
        unwrap(this).getElementType()?.let(ParameterValueType::wrap)

    /**
     * The name of the parameter store value.
     *
     * This value can be a token or a concrete string. If it is a concrete string
     * and includes "/" it must also be prefixed with a "/" (fully-qualified).
     */
    override fun parameterName(): String = unwrap(this).getParameterName()

    /**
     * Indicates whether the parameter name is a simple name.
     *
     * A parameter name
     * without any "/" is considered a simple name. If the parameter name includes
     * "/", setting simpleName to true might cause unintended issues such
     * as duplicate "/" in the resulting ARN.
     *
     * This is required only if `parameterName` is a token, which means we
     * are unable to detect if the name is simple or "path-like" for the purpose
     * of rendering SSM parameter ARNs.
     *
     * If `parameterName` is not specified, `simpleName` must be `true` (or
     * undefined) since the name generated by AWS CloudFormation is always a
     * simple name.
     *
     * Default: - auto-detect based on `parameterName`
     */
    override fun simpleName(): Boolean? = unwrap(this).getSimpleName()

    /**
     * The version number of the value you wish to retrieve.
     *
     * Default: The latest version will be retrieved.
     */
    override fun version(): Number? = unwrap(this).getVersion()
  }

  public companion object {
    public operator fun invoke(block: Builder.() -> Unit = {}): ListParameterAttributes {
      val builderImpl = BuilderImpl()
      return Wrapper(builderImpl.apply(block).build())
    }

    internal fun wrap(cdkObject: software.amazon.awscdk.services.ssm.ListParameterAttributes):
        ListParameterAttributes = CdkObjectWrappers.wrap(cdkObject) as? ListParameterAttributes ?:
        Wrapper(cdkObject)

    internal fun unwrap(wrapped: ListParameterAttributes):
        software.amazon.awscdk.services.ssm.ListParameterAttributes = (wrapped as
        CdkObject).cdkObject as software.amazon.awscdk.services.ssm.ListParameterAttributes
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy