commonMain.aws.sdk.kotlin.services.servicequotas.model.ServiceQuota.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.servicequotas.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Information about a quota.
*/
public class ServiceQuota private constructor(builder: Builder) {
/**
* Indicates whether the quota value can be increased.
*/
public val adjustable: kotlin.Boolean = builder.adjustable
/**
* The error code and error reason.
*/
public val errorReason: aws.sdk.kotlin.services.servicequotas.model.ErrorReason? = builder.errorReason
/**
* Indicates whether the quota is global.
*/
public val globalQuota: kotlin.Boolean = builder.globalQuota
/**
* The period of time.
*/
public val period: aws.sdk.kotlin.services.servicequotas.model.QuotaPeriod? = builder.period
/**
* Specifies at which level of granularity that the quota value is applied.
*/
public val quotaAppliedAtLevel: aws.sdk.kotlin.services.servicequotas.model.AppliedLevelEnum? = builder.quotaAppliedAtLevel
/**
* The Amazon Resource Name (ARN) of the quota.
*/
public val quotaArn: kotlin.String? = builder.quotaArn
/**
* Specifies the quota identifier. To find the quota code for a specific quota, use the ListServiceQuotas operation, and look for the `QuotaCode` response in the output for the quota you want.
*/
public val quotaCode: kotlin.String? = builder.quotaCode
/**
* The context for this service quota.
*/
public val quotaContext: aws.sdk.kotlin.services.servicequotas.model.QuotaContextInfo? = builder.quotaContext
/**
* Specifies the quota name.
*/
public val quotaName: kotlin.String? = builder.quotaName
/**
* Specifies the service identifier. To find the service code value for an Amazon Web Services service, use the ListServices operation.
*/
public val serviceCode: kotlin.String? = builder.serviceCode
/**
* Specifies the service name.
*/
public val serviceName: kotlin.String? = builder.serviceName
/**
* The unit of measurement.
*/
public val unit: kotlin.String? = builder.unit
/**
* Information about the measurement.
*/
public val usageMetric: aws.sdk.kotlin.services.servicequotas.model.MetricInfo? = builder.usageMetric
/**
* The quota value.
*/
public val value: kotlin.Double? = builder.value
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.servicequotas.model.ServiceQuota = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ServiceQuota(")
append("adjustable=$adjustable,")
append("errorReason=$errorReason,")
append("globalQuota=$globalQuota,")
append("period=$period,")
append("quotaAppliedAtLevel=$quotaAppliedAtLevel,")
append("quotaArn=$quotaArn,")
append("quotaCode=$quotaCode,")
append("quotaContext=$quotaContext,")
append("quotaName=$quotaName,")
append("serviceCode=$serviceCode,")
append("serviceName=$serviceName,")
append("unit=$unit,")
append("usageMetric=$usageMetric,")
append("value=$value")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = adjustable.hashCode()
result = 31 * result + (errorReason?.hashCode() ?: 0)
result = 31 * result + (globalQuota.hashCode())
result = 31 * result + (period?.hashCode() ?: 0)
result = 31 * result + (quotaAppliedAtLevel?.hashCode() ?: 0)
result = 31 * result + (quotaArn?.hashCode() ?: 0)
result = 31 * result + (quotaCode?.hashCode() ?: 0)
result = 31 * result + (quotaContext?.hashCode() ?: 0)
result = 31 * result + (quotaName?.hashCode() ?: 0)
result = 31 * result + (serviceCode?.hashCode() ?: 0)
result = 31 * result + (serviceName?.hashCode() ?: 0)
result = 31 * result + (unit?.hashCode() ?: 0)
result = 31 * result + (usageMetric?.hashCode() ?: 0)
result = 31 * result + (value?.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 ServiceQuota
if (adjustable != other.adjustable) return false
if (errorReason != other.errorReason) return false
if (globalQuota != other.globalQuota) return false
if (period != other.period) return false
if (quotaAppliedAtLevel != other.quotaAppliedAtLevel) return false
if (quotaArn != other.quotaArn) return false
if (quotaCode != other.quotaCode) return false
if (quotaContext != other.quotaContext) return false
if (quotaName != other.quotaName) return false
if (serviceCode != other.serviceCode) return false
if (serviceName != other.serviceName) return false
if (unit != other.unit) return false
if (usageMetric != other.usageMetric) return false
if (!(value?.equals(other.value) ?: (other.value == null))) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.servicequotas.model.ServiceQuota = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Indicates whether the quota value can be increased.
*/
public var adjustable: kotlin.Boolean = false
/**
* The error code and error reason.
*/
public var errorReason: aws.sdk.kotlin.services.servicequotas.model.ErrorReason? = null
/**
* Indicates whether the quota is global.
*/
public var globalQuota: kotlin.Boolean = false
/**
* The period of time.
*/
public var period: aws.sdk.kotlin.services.servicequotas.model.QuotaPeriod? = null
/**
* Specifies at which level of granularity that the quota value is applied.
*/
public var quotaAppliedAtLevel: aws.sdk.kotlin.services.servicequotas.model.AppliedLevelEnum? = null
/**
* The Amazon Resource Name (ARN) of the quota.
*/
public var quotaArn: kotlin.String? = null
/**
* Specifies the quota identifier. To find the quota code for a specific quota, use the ListServiceQuotas operation, and look for the `QuotaCode` response in the output for the quota you want.
*/
public var quotaCode: kotlin.String? = null
/**
* The context for this service quota.
*/
public var quotaContext: aws.sdk.kotlin.services.servicequotas.model.QuotaContextInfo? = null
/**
* Specifies the quota name.
*/
public var quotaName: kotlin.String? = null
/**
* Specifies the service identifier. To find the service code value for an Amazon Web Services service, use the ListServices operation.
*/
public var serviceCode: kotlin.String? = null
/**
* Specifies the service name.
*/
public var serviceName: kotlin.String? = null
/**
* The unit of measurement.
*/
public var unit: kotlin.String? = null
/**
* Information about the measurement.
*/
public var usageMetric: aws.sdk.kotlin.services.servicequotas.model.MetricInfo? = null
/**
* The quota value.
*/
public var value: kotlin.Double? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.servicequotas.model.ServiceQuota) : this() {
this.adjustable = x.adjustable
this.errorReason = x.errorReason
this.globalQuota = x.globalQuota
this.period = x.period
this.quotaAppliedAtLevel = x.quotaAppliedAtLevel
this.quotaArn = x.quotaArn
this.quotaCode = x.quotaCode
this.quotaContext = x.quotaContext
this.quotaName = x.quotaName
this.serviceCode = x.serviceCode
this.serviceName = x.serviceName
this.unit = x.unit
this.usageMetric = x.usageMetric
this.value = x.value
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.servicequotas.model.ServiceQuota = ServiceQuota(this)
/**
* construct an [aws.sdk.kotlin.services.servicequotas.model.ErrorReason] inside the given [block]
*/
public fun errorReason(block: aws.sdk.kotlin.services.servicequotas.model.ErrorReason.Builder.() -> kotlin.Unit) {
this.errorReason = aws.sdk.kotlin.services.servicequotas.model.ErrorReason.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.servicequotas.model.QuotaPeriod] inside the given [block]
*/
public fun period(block: aws.sdk.kotlin.services.servicequotas.model.QuotaPeriod.Builder.() -> kotlin.Unit) {
this.period = aws.sdk.kotlin.services.servicequotas.model.QuotaPeriod.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.servicequotas.model.QuotaContextInfo] inside the given [block]
*/
public fun quotaContext(block: aws.sdk.kotlin.services.servicequotas.model.QuotaContextInfo.Builder.() -> kotlin.Unit) {
this.quotaContext = aws.sdk.kotlin.services.servicequotas.model.QuotaContextInfo.invoke(block)
}
/**
* construct an [aws.sdk.kotlin.services.servicequotas.model.MetricInfo] inside the given [block]
*/
public fun usageMetric(block: aws.sdk.kotlin.services.servicequotas.model.MetricInfo.Builder.() -> kotlin.Unit) {
this.usageMetric = aws.sdk.kotlin.services.servicequotas.model.MetricInfo.invoke(block)
}
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy