commonMain.aws.sdk.kotlin.services.cognitosync.model.Dataset.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cognitosync-jvm Show documentation
Show all versions of cognitosync-jvm Show documentation
The AWS SDK for Kotlin client for Cognito Sync
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cognitosync.model
import aws.smithy.kotlin.runtime.SdkDsl
import aws.smithy.kotlin.runtime.time.Instant
/**
* A collection of data for an identity pool. An identity pool can have multiple datasets. A dataset is per identity and can be general or associated with a particular entity in an application (like a saved game). Datasets are automatically created if they don't exist. Data is synced by dataset, and a dataset can hold up to 1MB of key-value pairs.
*/
public class Dataset private constructor(builder: Builder) {
/**
* Date on which the dataset was created.
*/
public val creationDate: aws.smithy.kotlin.runtime.time.Instant? = builder.creationDate
/**
* Total size in bytes of the records in this dataset.
*/
public val dataStorage: kotlin.Long? = builder.dataStorage
/**
* A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
*/
public val datasetName: kotlin.String? = builder.datasetName
/**
* A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
*/
public val identityId: kotlin.String? = builder.identityId
/**
* The device that made the last change to this dataset.
*/
public val lastModifiedBy: kotlin.String? = builder.lastModifiedBy
/**
* Date when the dataset was last modified.
*/
public val lastModifiedDate: aws.smithy.kotlin.runtime.time.Instant? = builder.lastModifiedDate
/**
* Number of records in this dataset.
*/
public val numRecords: kotlin.Long? = builder.numRecords
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cognitosync.model.Dataset = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Dataset(")
append("creationDate=$creationDate,")
append("dataStorage=$dataStorage,")
append("datasetName=$datasetName,")
append("identityId=$identityId,")
append("lastModifiedBy=$lastModifiedBy,")
append("lastModifiedDate=$lastModifiedDate,")
append("numRecords=$numRecords")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = creationDate?.hashCode() ?: 0
result = 31 * result + (dataStorage?.hashCode() ?: 0)
result = 31 * result + (datasetName?.hashCode() ?: 0)
result = 31 * result + (identityId?.hashCode() ?: 0)
result = 31 * result + (lastModifiedBy?.hashCode() ?: 0)
result = 31 * result + (lastModifiedDate?.hashCode() ?: 0)
result = 31 * result + (numRecords?.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 Dataset
if (creationDate != other.creationDate) return false
if (dataStorage != other.dataStorage) return false
if (datasetName != other.datasetName) return false
if (identityId != other.identityId) return false
if (lastModifiedBy != other.lastModifiedBy) return false
if (lastModifiedDate != other.lastModifiedDate) return false
if (numRecords != other.numRecords) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cognitosync.model.Dataset = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Date on which the dataset was created.
*/
public var creationDate: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* Total size in bytes of the records in this dataset.
*/
public var dataStorage: kotlin.Long? = null
/**
* A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, '_' (underscore), '-' (dash), and '.' (dot).
*/
public var datasetName: kotlin.String? = null
/**
* A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.
*/
public var identityId: kotlin.String? = null
/**
* The device that made the last change to this dataset.
*/
public var lastModifiedBy: kotlin.String? = null
/**
* Date when the dataset was last modified.
*/
public var lastModifiedDate: aws.smithy.kotlin.runtime.time.Instant? = null
/**
* Number of records in this dataset.
*/
public var numRecords: kotlin.Long? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cognitosync.model.Dataset) : this() {
this.creationDate = x.creationDate
this.dataStorage = x.dataStorage
this.datasetName = x.datasetName
this.identityId = x.identityId
this.lastModifiedBy = x.lastModifiedBy
this.lastModifiedDate = x.lastModifiedDate
this.numRecords = x.numRecords
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cognitosync.model.Dataset = Dataset(this)
internal fun correctErrors(): Builder {
return this
}
}
}