commonMain.aws.sdk.kotlin.services.configservice.model.OrganizationCustomRuleMetadata.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of configservice-jvm Show documentation
Show all versions of configservice-jvm Show documentation
The AWS SDK for Kotlin client for Config Service
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.configservice.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* An object that specifies organization custom rule metadata such as resource type, resource ID of Amazon Web Services resource, Lambda function ARN, and organization trigger types that trigger Config to evaluate your Amazon Web Services resources against a rule. It also provides the frequency with which you want Config to run evaluations for the rule if the trigger type is periodic.
*/
public class OrganizationCustomRuleMetadata private constructor(builder: Builder) {
/**
* The description that you provide for your organization Config rule.
*/
public val description: kotlin.String? = builder.description
/**
* A string, in JSON format, that is passed to your organization Config rule Lambda function.
*/
public val inputParameters: kotlin.String? = builder.inputParameters
/**
* The lambda function ARN.
*/
public val lambdaFunctionArn: kotlin.String = requireNotNull(builder.lambdaFunctionArn) { "A non-null value must be provided for lambdaFunctionArn" }
/**
* The maximum frequency with which Config runs evaluations for a rule. Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
*
* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the `MaximumExecutionFrequency` parameter.
*/
public val maximumExecutionFrequency: aws.sdk.kotlin.services.configservice.model.MaximumExecutionFrequency? = builder.maximumExecutionFrequency
/**
* The type of notification that triggers Config to run an evaluation for a rule. You can specify the following notification types:
* + `ConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers a configuration item as a result of a resource change.
* + `OversizedConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers an oversized configuration item. Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.
* + `ScheduledNotification` - Triggers a periodic evaluation at the frequency specified for `MaximumExecutionFrequency`.
*/
public val organizationConfigRuleTriggerTypes: List = requireNotNull(builder.organizationConfigRuleTriggerTypes) { "A non-null value must be provided for organizationConfigRuleTriggerTypes" }
/**
* The ID of the Amazon Web Services resource that was evaluated.
*/
public val resourceIdScope: kotlin.String? = builder.resourceIdScope
/**
* The type of the Amazon Web Services resource that was evaluated.
*/
public val resourceTypesScope: List? = builder.resourceTypesScope
/**
* One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
*/
public val tagKeyScope: kotlin.String? = builder.tagKeyScope
/**
* The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
*/
public val tagValueScope: kotlin.String? = builder.tagValueScope
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.configservice.model.OrganizationCustomRuleMetadata = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("OrganizationCustomRuleMetadata(")
append("description=$description,")
append("inputParameters=$inputParameters,")
append("lambdaFunctionArn=$lambdaFunctionArn,")
append("maximumExecutionFrequency=$maximumExecutionFrequency,")
append("organizationConfigRuleTriggerTypes=$organizationConfigRuleTriggerTypes,")
append("resourceIdScope=$resourceIdScope,")
append("resourceTypesScope=$resourceTypesScope,")
append("tagKeyScope=$tagKeyScope,")
append("tagValueScope=$tagValueScope")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = description?.hashCode() ?: 0
result = 31 * result + (inputParameters?.hashCode() ?: 0)
result = 31 * result + (lambdaFunctionArn.hashCode())
result = 31 * result + (maximumExecutionFrequency?.hashCode() ?: 0)
result = 31 * result + (organizationConfigRuleTriggerTypes.hashCode())
result = 31 * result + (resourceIdScope?.hashCode() ?: 0)
result = 31 * result + (resourceTypesScope?.hashCode() ?: 0)
result = 31 * result + (tagKeyScope?.hashCode() ?: 0)
result = 31 * result + (tagValueScope?.hashCode() ?: 0)
return result
}
override fun equals(other: kotlin.Any?): kotlin.Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as OrganizationCustomRuleMetadata
if (description != other.description) return false
if (inputParameters != other.inputParameters) return false
if (lambdaFunctionArn != other.lambdaFunctionArn) return false
if (maximumExecutionFrequency != other.maximumExecutionFrequency) return false
if (organizationConfigRuleTriggerTypes != other.organizationConfigRuleTriggerTypes) return false
if (resourceIdScope != other.resourceIdScope) return false
if (resourceTypesScope != other.resourceTypesScope) return false
if (tagKeyScope != other.tagKeyScope) return false
if (tagValueScope != other.tagValueScope) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.configservice.model.OrganizationCustomRuleMetadata = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The description that you provide for your organization Config rule.
*/
public var description: kotlin.String? = null
/**
* A string, in JSON format, that is passed to your organization Config rule Lambda function.
*/
public var inputParameters: kotlin.String? = null
/**
* The lambda function ARN.
*/
public var lambdaFunctionArn: kotlin.String? = null
/**
* The maximum frequency with which Config runs evaluations for a rule. Your custom rule is triggered when Config delivers the configuration snapshot. For more information, see ConfigSnapshotDeliveryProperties.
*
* By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the `MaximumExecutionFrequency` parameter.
*/
public var maximumExecutionFrequency: aws.sdk.kotlin.services.configservice.model.MaximumExecutionFrequency? = null
/**
* The type of notification that triggers Config to run an evaluation for a rule. You can specify the following notification types:
* + `ConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers a configuration item as a result of a resource change.
* + `OversizedConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers an oversized configuration item. Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.
* + `ScheduledNotification` - Triggers a periodic evaluation at the frequency specified for `MaximumExecutionFrequency`.
*/
public var organizationConfigRuleTriggerTypes: List? = null
/**
* The ID of the Amazon Web Services resource that was evaluated.
*/
public var resourceIdScope: kotlin.String? = null
/**
* The type of the Amazon Web Services resource that was evaluated.
*/
public var resourceTypesScope: List? = null
/**
* One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
*/
public var tagKeyScope: kotlin.String? = null
/**
* The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
*/
public var tagValueScope: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.configservice.model.OrganizationCustomRuleMetadata) : this() {
this.description = x.description
this.inputParameters = x.inputParameters
this.lambdaFunctionArn = x.lambdaFunctionArn
this.maximumExecutionFrequency = x.maximumExecutionFrequency
this.organizationConfigRuleTriggerTypes = x.organizationConfigRuleTriggerTypes
this.resourceIdScope = x.resourceIdScope
this.resourceTypesScope = x.resourceTypesScope
this.tagKeyScope = x.tagKeyScope
this.tagValueScope = x.tagValueScope
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.configservice.model.OrganizationCustomRuleMetadata = OrganizationCustomRuleMetadata(this)
internal fun correctErrors(): Builder {
if (lambdaFunctionArn == null) lambdaFunctionArn = ""
if (organizationConfigRuleTriggerTypes == null) organizationConfigRuleTriggerTypes = emptyList()
return this
}
}
}