
commonMain.aws.sdk.kotlin.services.lightsail.model.Origin.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.lightsail.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* Describes the origin resource of an Amazon Lightsail content delivery network (CDN) distribution.
*
* An origin can be a Lightsail instance, bucket, or load balancer. A distribution pulls content from an origin, caches it, and serves it to viewers via a worldwide network of edge servers.
*/
public class Origin private constructor(builder: Builder) {
/**
* The name of the origin resource.
*/
public val name: kotlin.String? = builder.name
/**
* The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.
*/
public val protocolPolicy: aws.sdk.kotlin.services.lightsail.model.OriginProtocolPolicyEnum? = builder.protocolPolicy
/**
* The AWS Region name of the origin resource.
*/
public val regionName: aws.sdk.kotlin.services.lightsail.model.RegionName? = builder.regionName
/**
* The resource type of the origin resource (*Instance*).
*/
public val resourceType: aws.sdk.kotlin.services.lightsail.model.ResourceType? = builder.resourceType
/**
* The amount of time, in seconds, that the distribution waits for a response after forwarding a request to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.
*/
public val responseTimeout: kotlin.Int? = builder.responseTimeout
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lightsail.model.Origin = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Origin(")
append("name=$name,")
append("protocolPolicy=$protocolPolicy,")
append("regionName=$regionName,")
append("resourceType=$resourceType,")
append("responseTimeout=$responseTimeout")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = name?.hashCode() ?: 0
result = 31 * result + (protocolPolicy?.hashCode() ?: 0)
result = 31 * result + (regionName?.hashCode() ?: 0)
result = 31 * result + (resourceType?.hashCode() ?: 0)
result = 31 * result + (responseTimeout ?: 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 Origin
if (name != other.name) return false
if (protocolPolicy != other.protocolPolicy) return false
if (regionName != other.regionName) return false
if (resourceType != other.resourceType) return false
if (responseTimeout != other.responseTimeout) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.lightsail.model.Origin = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the origin resource.
*/
public var name: kotlin.String? = null
/**
* The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content.
*/
public var protocolPolicy: aws.sdk.kotlin.services.lightsail.model.OriginProtocolPolicyEnum? = null
/**
* The AWS Region name of the origin resource.
*/
public var regionName: aws.sdk.kotlin.services.lightsail.model.RegionName? = null
/**
* The resource type of the origin resource (*Instance*).
*/
public var resourceType: aws.sdk.kotlin.services.lightsail.model.ResourceType? = null
/**
* The amount of time, in seconds, that the distribution waits for a response after forwarding a request to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds.
*/
public var responseTimeout: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.lightsail.model.Origin) : this() {
this.name = x.name
this.protocolPolicy = x.protocolPolicy
this.regionName = x.regionName
this.resourceType = x.resourceType
this.responseTimeout = x.responseTimeout
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.lightsail.model.Origin = Origin(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy