From 7260841f87d66ac10fe4f1cb80176167d1197fef Mon Sep 17 00:00:00 2001 From: cloudpdf-sdk-bot Date: Thu, 20 Aug 2026 21:06:51 +0000 Subject: [PATCH] chore: generate CloudPDF Go SDK 3.0.0-next.6 --- .fern/metadata.json | 6 +- cloudpdf-generation.json | 8 +- core/request_option.go | 4 +- documents.go | 3580 +++++---- documents/client.go | 32 + documents/documents_test/documents_test.go | 31 + documents/raw_client.go | 47 + documents_test.go | 7793 +++++++++++++------- error_codes.go | 5 + errors.go | 24 + reference.md | 121 + types.go | 1009 +++ types_test.go | 2378 ++++++ wiremock/wiremock-mappings.json | 38 +- 14 files changed, 11106 insertions(+), 3970 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 2e52d59..090b4eb 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -9,10 +9,10 @@ "version": "1.21" } }, - "originGitCommit": "81e6a2097d2997ef713a3013668e5eae0e748575", + "originGitCommit": "32635f40577b214f6a6b3189a2271425c3a574fd", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-next.5", + "requestedVersion": "3.0.0-next.6", "ciProvider": "github", - "sdkVersion": "v3.0.0-next.5" + "sdkVersion": "v3.0.0-next.6" } \ No newline at end of file diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index e02ec3a..38a3488 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "go", - "canonicalVersion": "3.0.0-next.5", - "sdkVersion": "3.0.0-next.5", + "canonicalVersion": "3.0.0-next.6", + "sdkVersion": "3.0.0-next.6", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "e86b3f1766a77c28cb782a6513b5a86998668cd4e688e5b5ac27342e58637cd7", - "gitCommit": "81e6a2097d2997ef713a3013668e5eae0e748575", + "openapiSha256": "b3e236a932673e27e05825352e1bc3675369d7505040bf7d7760e542aae8d38d", + "gitCommit": "32635f40577b214f6a6b3189a2271425c3a574fd", "gitCommitIsDirty": false }, "fern": { diff --git a/core/request_option.go b/core/request_option.go index c4e6913..1c4ca4c 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -65,8 +65,8 @@ func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/embedpdf/cloudpdf-sdk-go/v3") - headers.Set("X-Fern-SDK-Version", "v3.0.0-next.5") - headers.Set("User-Agent", "github.com/embedpdf/cloudpdf-sdk-go/v3/3.0.0-next.5") + headers.Set("X-Fern-SDK-Version", "v3.0.0-next.6") + headers.Set("User-Agent", "github.com/embedpdf/cloudpdf-sdk-go/v3/3.0.0-next.6") return headers } diff --git a/documents.go b/documents.go index 7272a58..96d5f3c 100644 --- a/documents.go +++ b/documents.go @@ -176,6 +176,115 @@ func (g *GetDocumentsRequest) SetID(id string) { g.require(getDocumentsRequestFieldID) } +var ( + documentsImportFromRequestFieldTenantID = big.NewInt(1 << 0) + documentsImportFromRequestFieldSource = big.NewInt(1 << 1) + documentsImportFromRequestFieldExpected = big.NewInt(1 << 2) + documentsImportFromRequestFieldMetadata = big.NewInt(1 << 3) + documentsImportFromRequestFieldIdempotencyKey = big.NewInt(1 << 4) + documentsImportFromRequestFieldDedupMode = big.NewInt(1 << 5) + documentsImportFromRequestFieldDocID = big.NewInt(1 << 6) + documentsImportFromRequestFieldMode = big.NewInt(1 << 7) +) + +type DocumentsImportFromRequest struct { + TenantID string `json:"-" url:"-"` + Source *DocumentsImportFromRequestSource `json:"source" url:"-"` + Expected *DocumentsImportFromRequestExpected `json:"expected,omitempty" url:"-"` + Metadata map[string]any `json:"metadata,omitempty" url:"-"` + IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"-"` + DedupMode *DocumentsImportFromRequestDedupMode `json:"dedupMode,omitempty" url:"-"` + DocID *string `json:"docId,omitempty" url:"-"` + Mode *DocumentsImportFromRequestMode `json:"mode,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (d *DocumentsImportFromRequest) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetTenantID sets the TenantID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetTenantID(tenantID string) { + d.TenantID = tenantID + d.require(documentsImportFromRequestFieldTenantID) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetSource(source *DocumentsImportFromRequestSource) { + d.Source = source + d.require(documentsImportFromRequestFieldSource) +} + +// SetExpected sets the Expected field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetExpected(expected *DocumentsImportFromRequestExpected) { + d.Expected = expected + d.require(documentsImportFromRequestFieldExpected) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetMetadata(metadata map[string]any) { + d.Metadata = metadata + d.require(documentsImportFromRequestFieldMetadata) +} + +// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetIdempotencyKey(idempotencyKey *string) { + d.IdempotencyKey = idempotencyKey + d.require(documentsImportFromRequestFieldIdempotencyKey) +} + +// SetDedupMode sets the DedupMode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetDedupMode(dedupMode *DocumentsImportFromRequestDedupMode) { + d.DedupMode = dedupMode + d.require(documentsImportFromRequestFieldDedupMode) +} + +// SetDocID sets the DocID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetDocID(docID *string) { + d.DocID = docID + d.require(documentsImportFromRequestFieldDocID) +} + +// SetMode sets the Mode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFromRequest) SetMode(mode *DocumentsImportFromRequestMode) { + d.Mode = mode + d.require(documentsImportFromRequestFieldMode) +} + +func (d *DocumentsImportFromRequest) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFromRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *d = DocumentsImportFromRequest(body) + return nil +} + +func (d *DocumentsImportFromRequest) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFromRequest + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( documentsInitRequestFieldTenantID = big.NewInt(1 << 0) documentsInitRequestFieldContentLength = big.NewInt(1 << 1) @@ -1212,164 +1321,14 @@ func (d DocumentsGet200ResponseDocumentThumbnailState) Ptr() *DocumentsGet200Res return &d } -type DocumentsInit200Response struct { - Tag string - Created *DocumentsInit200ResponseCreated - Resumed *DocumentsInit200ResponseResumed - Deduped *DocumentsInit200ResponseDeduped - - rawJSON json.RawMessage -} - -func (d *DocumentsInit200Response) GetTag() string { - if d == nil { - return "" - } - return d.Tag -} - -func (d *DocumentsInit200Response) GetCreated() *DocumentsInit200ResponseCreated { - if d == nil { - return nil - } - return d.Created -} - -func (d *DocumentsInit200Response) GetResumed() *DocumentsInit200ResponseResumed { - if d == nil { - return nil - } - return d.Resumed -} - -func (d *DocumentsInit200Response) GetDeduped() *DocumentsInit200ResponseDeduped { - if d == nil { - return nil - } - return d.Deduped -} - -func (d *DocumentsInit200Response) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Tag string `json:"tag"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - d.Tag = unmarshaler.Tag - if unmarshaler.Tag == "" { - return fmt.Errorf("%T did not include discriminant tag", d) - } - switch unmarshaler.Tag { - case "created": - value := new(DocumentsInit200ResponseCreated) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - d.Created = value - case "resumed": - value := new(DocumentsInit200ResponseResumed) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - d.Resumed = value - case "deduped": - value := new(DocumentsInit200ResponseDeduped) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - d.Deduped = value - } - d.rawJSON = json.RawMessage(data) - return nil -} - -func (d DocumentsInit200Response) MarshalJSON() ([]byte, error) { - if err := d.validate(); err != nil { - return nil, err - } - if d.Created != nil { - return internal.MarshalJSONWithExtraProperty(d.Created, "tag", "created") - } - if d.Resumed != nil { - return internal.MarshalJSONWithExtraProperty(d.Resumed, "tag", "resumed") - } - if d.Deduped != nil { - return internal.MarshalJSONWithExtraProperty(d.Deduped, "tag", "deduped") - } - if len(d.rawJSON) > 0 { - return d.rawJSON, nil - } - return nil, fmt.Errorf("type %T does not define a non-empty union type", d) -} - -type DocumentsInit200ResponseVisitor interface { - VisitCreated(*DocumentsInit200ResponseCreated) error - VisitResumed(*DocumentsInit200ResponseResumed) error - VisitDeduped(*DocumentsInit200ResponseDeduped) error -} - -func (d *DocumentsInit200Response) Accept(visitor DocumentsInit200ResponseVisitor) error { - if d.Created != nil { - return visitor.VisitCreated(d.Created) - } - if d.Resumed != nil { - return visitor.VisitResumed(d.Resumed) - } - if d.Deduped != nil { - return visitor.VisitDeduped(d.Deduped) - } - return fmt.Errorf("type %T does not define a non-empty union type", d) -} - -func (d *DocumentsInit200Response) validate() error { - if d == nil { - return fmt.Errorf("type %T is nil", d) - } - var fields []string - if d.Created != nil { - fields = append(fields, "created") - } - if d.Resumed != nil { - fields = append(fields, "resumed") - } - if d.Deduped != nil { - fields = append(fields, "deduped") - } - if len(fields) == 0 { - if d.Tag != "" { - if len(d.rawJSON) > 0 { - return nil - } - return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", d, d.Tag) - } - return fmt.Errorf("type %T is empty", d) - } - if len(fields) > 1 { - return fmt.Errorf("type %T defines values for %s, but only one value is allowed", d, fields) - } - if d.Tag != "" { - field := fields[0] - if d.Tag != field { - return fmt.Errorf( - "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", - d, - d.Tag, - d, - ) - } - } - return nil -} - var ( - documentsInit200ResponseCreatedFieldDocument = big.NewInt(1 << 0) - documentsInit200ResponseCreatedFieldUpload = big.NewInt(1 << 1) + documentsImportFrom200ResponseFieldTag = big.NewInt(1 << 0) + documentsImportFrom200ResponseFieldDocument = big.NewInt(1 << 1) ) -type DocumentsInit200ResponseCreated struct { - Document *DocumentsInit200ResponseCreatedDocument `json:"document" url:"document"` - Upload *DocumentsInit200ResponseCreatedUpload `json:"upload" url:"upload"` +type DocumentsImportFrom200Response struct { + Tag DocumentsImportFrom200ResponseTag `json:"tag" url:"tag"` + Document *DocumentsImportFrom200ResponseDocument `json:"document" url:"document"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -1378,55 +1337,55 @@ type DocumentsInit200ResponseCreated struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseCreated) GetDocument() *DocumentsInit200ResponseCreatedDocument { +func (d *DocumentsImportFrom200Response) GetTag() DocumentsImportFrom200ResponseTag { if d == nil { - return nil + return "" } - return d.Document + return d.Tag } -func (d *DocumentsInit200ResponseCreated) GetUpload() *DocumentsInit200ResponseCreatedUpload { +func (d *DocumentsImportFrom200Response) GetDocument() *DocumentsImportFrom200ResponseDocument { if d == nil { return nil } - return d.Upload + return d.Document } -func (d *DocumentsInit200ResponseCreated) GetExtraProperties() map[string]interface{} { +func (d *DocumentsImportFrom200Response) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseCreated) require(field *big.Int) { +func (d *DocumentsImportFrom200Response) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetDocument sets the Document field and marks it as non-optional; +// SetTag sets the Tag field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreated) SetDocument(document *DocumentsInit200ResponseCreatedDocument) { - d.Document = document - d.require(documentsInit200ResponseCreatedFieldDocument) +func (d *DocumentsImportFrom200Response) SetTag(tag DocumentsImportFrom200ResponseTag) { + d.Tag = tag + d.require(documentsImportFrom200ResponseFieldTag) } -// SetUpload sets the Upload field and marks it as non-optional; +// SetDocument sets the Document field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreated) SetUpload(upload *DocumentsInit200ResponseCreatedUpload) { - d.Upload = upload - d.require(documentsInit200ResponseCreatedFieldUpload) +func (d *DocumentsImportFrom200Response) SetDocument(document *DocumentsImportFrom200ResponseDocument) { + d.Document = document + d.require(documentsImportFrom200ResponseFieldDocument) } -func (d *DocumentsInit200ResponseCreated) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseCreated +func (d *DocumentsImportFrom200Response) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom200Response var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseCreated(value) + *d = DocumentsImportFrom200Response(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -1436,8 +1395,8 @@ func (d *DocumentsInit200ResponseCreated) UnmarshalJSON(data []byte) error { return nil } -func (d *DocumentsInit200ResponseCreated) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseCreated +func (d *DocumentsImportFrom200Response) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom200Response var marshaler = struct { embed }{ @@ -1447,7 +1406,7 @@ func (d *DocumentsInit200ResponseCreated) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseCreated) String() string { +func (d *DocumentsImportFrom200Response) String() string { if d == nil { return "" } @@ -1463,35 +1422,35 @@ func (d *DocumentsInit200ResponseCreated) String() string { } var ( - documentsInit200ResponseCreatedDocumentFieldID = big.NewInt(1 << 0) - documentsInit200ResponseCreatedDocumentFieldTenantID = big.NewInt(1 << 1) - documentsInit200ResponseCreatedDocumentFieldState = big.NewInt(1 << 2) - documentsInit200ResponseCreatedDocumentFieldBaseSha = big.NewInt(1 << 3) - documentsInit200ResponseCreatedDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) - documentsInit200ResponseCreatedDocumentFieldMetadata = big.NewInt(1 << 5) - documentsInit200ResponseCreatedDocumentFieldIdempotencyKey = big.NewInt(1 << 6) - documentsInit200ResponseCreatedDocumentFieldFailureReason = big.NewInt(1 << 7) - documentsInit200ResponseCreatedDocumentFieldThumbnailState = big.NewInt(1 << 8) - documentsInit200ResponseCreatedDocumentFieldThumbnailURL = big.NewInt(1 << 9) - documentsInit200ResponseCreatedDocumentFieldCreatedAt = big.NewInt(1 << 10) - documentsInit200ResponseCreatedDocumentFieldUpdatedAt = big.NewInt(1 << 11) - documentsInit200ResponseCreatedDocumentFieldCreatedBy = big.NewInt(1 << 12) + documentsImportFrom200ResponseDocumentFieldID = big.NewInt(1 << 0) + documentsImportFrom200ResponseDocumentFieldTenantID = big.NewInt(1 << 1) + documentsImportFrom200ResponseDocumentFieldState = big.NewInt(1 << 2) + documentsImportFrom200ResponseDocumentFieldBaseSha = big.NewInt(1 << 3) + documentsImportFrom200ResponseDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) + documentsImportFrom200ResponseDocumentFieldMetadata = big.NewInt(1 << 5) + documentsImportFrom200ResponseDocumentFieldIdempotencyKey = big.NewInt(1 << 6) + documentsImportFrom200ResponseDocumentFieldFailureReason = big.NewInt(1 << 7) + documentsImportFrom200ResponseDocumentFieldThumbnailState = big.NewInt(1 << 8) + documentsImportFrom200ResponseDocumentFieldThumbnailURL = big.NewInt(1 << 9) + documentsImportFrom200ResponseDocumentFieldCreatedAt = big.NewInt(1 << 10) + documentsImportFrom200ResponseDocumentFieldUpdatedAt = big.NewInt(1 << 11) + documentsImportFrom200ResponseDocumentFieldCreatedBy = big.NewInt(1 << 12) ) -type DocumentsInit200ResponseCreatedDocument struct { - ID string `json:"id" url:"id"` - TenantID string `json:"tenantId" url:"tenantId"` - State DocumentsInit200ResponseCreatedDocumentState `json:"state" url:"state"` - BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` - StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` - Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` - IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` - FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` - ThumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` - ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` - CreatedAt float64 `json:"createdAt" url:"createdAt"` - UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` - CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` +type DocumentsImportFrom200ResponseDocument struct { + ID string `json:"id" url:"id"` + TenantID string `json:"tenantId" url:"tenantId"` + State DocumentsImportFrom200ResponseDocumentState `json:"state" url:"state"` + BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` + StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` + Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` + FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` + ThumbnailState *DocumentsImportFrom200ResponseDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` + ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` + CreatedAt float64 `json:"createdAt" url:"createdAt"` + UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -1500,105 +1459,105 @@ type DocumentsInit200ResponseCreatedDocument struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseCreatedDocument) GetID() string { +func (d *DocumentsImportFrom200ResponseDocument) GetID() string { if d == nil { return "" } return d.ID } -func (d *DocumentsInit200ResponseCreatedDocument) GetTenantID() string { +func (d *DocumentsImportFrom200ResponseDocument) GetTenantID() string { if d == nil { return "" } return d.TenantID } -func (d *DocumentsInit200ResponseCreatedDocument) GetState() DocumentsInit200ResponseCreatedDocumentState { +func (d *DocumentsImportFrom200ResponseDocument) GetState() DocumentsImportFrom200ResponseDocumentState { if d == nil { return "" } return d.State } -func (d *DocumentsInit200ResponseCreatedDocument) GetBaseSha() *string { +func (d *DocumentsImportFrom200ResponseDocument) GetBaseSha() *string { if d == nil { return nil } return d.BaseSha } -func (d *DocumentsInit200ResponseCreatedDocument) GetStorageSizeBytes() *float64 { +func (d *DocumentsImportFrom200ResponseDocument) GetStorageSizeBytes() *float64 { if d == nil { return nil } return d.StorageSizeBytes } -func (d *DocumentsInit200ResponseCreatedDocument) GetMetadata() map[string]any { +func (d *DocumentsImportFrom200ResponseDocument) GetMetadata() map[string]any { if d == nil { return nil } return d.Metadata } -func (d *DocumentsInit200ResponseCreatedDocument) GetIdempotencyKey() *string { +func (d *DocumentsImportFrom200ResponseDocument) GetIdempotencyKey() *string { if d == nil { return nil } return d.IdempotencyKey } -func (d *DocumentsInit200ResponseCreatedDocument) GetFailureReason() *string { +func (d *DocumentsImportFrom200ResponseDocument) GetFailureReason() *string { if d == nil { return nil } return d.FailureReason } -func (d *DocumentsInit200ResponseCreatedDocument) GetThumbnailState() *DocumentsInit200ResponseCreatedDocumentThumbnailState { +func (d *DocumentsImportFrom200ResponseDocument) GetThumbnailState() *DocumentsImportFrom200ResponseDocumentThumbnailState { if d == nil { return nil } return d.ThumbnailState } -func (d *DocumentsInit200ResponseCreatedDocument) GetThumbnailURL() *string { +func (d *DocumentsImportFrom200ResponseDocument) GetThumbnailURL() *string { if d == nil { return nil } return d.ThumbnailURL } -func (d *DocumentsInit200ResponseCreatedDocument) GetCreatedAt() float64 { +func (d *DocumentsImportFrom200ResponseDocument) GetCreatedAt() float64 { if d == nil { return 0 } return d.CreatedAt } -func (d *DocumentsInit200ResponseCreatedDocument) GetUpdatedAt() float64 { +func (d *DocumentsImportFrom200ResponseDocument) GetUpdatedAt() float64 { if d == nil { return 0 } return d.UpdatedAt } -func (d *DocumentsInit200ResponseCreatedDocument) GetCreatedBy() *string { +func (d *DocumentsImportFrom200ResponseDocument) GetCreatedBy() *string { if d == nil { return nil } return d.CreatedBy } -func (d *DocumentsInit200ResponseCreatedDocument) GetExtraProperties() map[string]interface{} { +func (d *DocumentsImportFrom200ResponseDocument) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseCreatedDocument) require(field *big.Int) { +func (d *DocumentsImportFrom200ResponseDocument) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } @@ -1607,102 +1566,102 @@ func (d *DocumentsInit200ResponseCreatedDocument) require(field *big.Int) { // SetID sets the ID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetID(id string) { +func (d *DocumentsImportFrom200ResponseDocument) SetID(id string) { d.ID = id - d.require(documentsInit200ResponseCreatedDocumentFieldID) + d.require(documentsImportFrom200ResponseDocumentFieldID) } // SetTenantID sets the TenantID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetTenantID(tenantID string) { +func (d *DocumentsImportFrom200ResponseDocument) SetTenantID(tenantID string) { d.TenantID = tenantID - d.require(documentsInit200ResponseCreatedDocumentFieldTenantID) + d.require(documentsImportFrom200ResponseDocumentFieldTenantID) } // SetState sets the State field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetState(state DocumentsInit200ResponseCreatedDocumentState) { +func (d *DocumentsImportFrom200ResponseDocument) SetState(state DocumentsImportFrom200ResponseDocumentState) { d.State = state - d.require(documentsInit200ResponseCreatedDocumentFieldState) + d.require(documentsImportFrom200ResponseDocumentFieldState) } // SetBaseSha sets the BaseSha field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetBaseSha(baseSha *string) { +func (d *DocumentsImportFrom200ResponseDocument) SetBaseSha(baseSha *string) { d.BaseSha = baseSha - d.require(documentsInit200ResponseCreatedDocumentFieldBaseSha) + d.require(documentsImportFrom200ResponseDocumentFieldBaseSha) } // SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetStorageSizeBytes(storageSizeBytes *float64) { +func (d *DocumentsImportFrom200ResponseDocument) SetStorageSizeBytes(storageSizeBytes *float64) { d.StorageSizeBytes = storageSizeBytes - d.require(documentsInit200ResponseCreatedDocumentFieldStorageSizeBytes) + d.require(documentsImportFrom200ResponseDocumentFieldStorageSizeBytes) } // SetMetadata sets the Metadata field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetMetadata(metadata map[string]any) { +func (d *DocumentsImportFrom200ResponseDocument) SetMetadata(metadata map[string]any) { d.Metadata = metadata - d.require(documentsInit200ResponseCreatedDocumentFieldMetadata) + d.require(documentsImportFrom200ResponseDocumentFieldMetadata) } // SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetIdempotencyKey(idempotencyKey *string) { +func (d *DocumentsImportFrom200ResponseDocument) SetIdempotencyKey(idempotencyKey *string) { d.IdempotencyKey = idempotencyKey - d.require(documentsInit200ResponseCreatedDocumentFieldIdempotencyKey) + d.require(documentsImportFrom200ResponseDocumentFieldIdempotencyKey) } // SetFailureReason sets the FailureReason field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetFailureReason(failureReason *string) { +func (d *DocumentsImportFrom200ResponseDocument) SetFailureReason(failureReason *string) { d.FailureReason = failureReason - d.require(documentsInit200ResponseCreatedDocumentFieldFailureReason) + d.require(documentsImportFrom200ResponseDocumentFieldFailureReason) } // SetThumbnailState sets the ThumbnailState field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetThumbnailState(thumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState) { +func (d *DocumentsImportFrom200ResponseDocument) SetThumbnailState(thumbnailState *DocumentsImportFrom200ResponseDocumentThumbnailState) { d.ThumbnailState = thumbnailState - d.require(documentsInit200ResponseCreatedDocumentFieldThumbnailState) + d.require(documentsImportFrom200ResponseDocumentFieldThumbnailState) } // SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetThumbnailURL(thumbnailURL *string) { +func (d *DocumentsImportFrom200ResponseDocument) SetThumbnailURL(thumbnailURL *string) { d.ThumbnailURL = thumbnailURL - d.require(documentsInit200ResponseCreatedDocumentFieldThumbnailURL) + d.require(documentsImportFrom200ResponseDocumentFieldThumbnailURL) } // SetCreatedAt sets the CreatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetCreatedAt(createdAt float64) { +func (d *DocumentsImportFrom200ResponseDocument) SetCreatedAt(createdAt float64) { d.CreatedAt = createdAt - d.require(documentsInit200ResponseCreatedDocumentFieldCreatedAt) + d.require(documentsImportFrom200ResponseDocumentFieldCreatedAt) } // SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetUpdatedAt(updatedAt float64) { +func (d *DocumentsImportFrom200ResponseDocument) SetUpdatedAt(updatedAt float64) { d.UpdatedAt = updatedAt - d.require(documentsInit200ResponseCreatedDocumentFieldUpdatedAt) + d.require(documentsImportFrom200ResponseDocumentFieldUpdatedAt) } // SetCreatedBy sets the CreatedBy field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedDocument) SetCreatedBy(createdBy *string) { +func (d *DocumentsImportFrom200ResponseDocument) SetCreatedBy(createdBy *string) { d.CreatedBy = createdBy - d.require(documentsInit200ResponseCreatedDocumentFieldCreatedBy) + d.require(documentsImportFrom200ResponseDocumentFieldCreatedBy) } -func (d *DocumentsInit200ResponseCreatedDocument) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseCreatedDocument +func (d *DocumentsImportFrom200ResponseDocument) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom200ResponseDocument var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseCreatedDocument(value) + *d = DocumentsImportFrom200ResponseDocument(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -1712,8 +1671,8 @@ func (d *DocumentsInit200ResponseCreatedDocument) UnmarshalJSON(data []byte) err return nil } -func (d *DocumentsInit200ResponseCreatedDocument) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseCreatedDocument +func (d *DocumentsImportFrom200ResponseDocument) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom200ResponseDocument var marshaler = struct { embed }{ @@ -1723,7 +1682,7 @@ func (d *DocumentsInit200ResponseCreatedDocument) MarshalJSON() ([]byte, error) return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseCreatedDocument) String() string { +func (d *DocumentsImportFrom200ResponseDocument) String() string { if d == nil { return "" } @@ -1738,129 +1697,171 @@ func (d *DocumentsInit200ResponseCreatedDocument) String() string { return fmt.Sprintf("%#v", d) } -type DocumentsInit200ResponseCreatedDocumentState string +type DocumentsImportFrom200ResponseDocumentState string const ( - DocumentsInit200ResponseCreatedDocumentStatePending DocumentsInit200ResponseCreatedDocumentState = "pending" - DocumentsInit200ResponseCreatedDocumentStateReady DocumentsInit200ResponseCreatedDocumentState = "ready" - DocumentsInit200ResponseCreatedDocumentStateFailed DocumentsInit200ResponseCreatedDocumentState = "failed" - DocumentsInit200ResponseCreatedDocumentStateDeleting DocumentsInit200ResponseCreatedDocumentState = "deleting" + DocumentsImportFrom200ResponseDocumentStatePending DocumentsImportFrom200ResponseDocumentState = "pending" + DocumentsImportFrom200ResponseDocumentStateReady DocumentsImportFrom200ResponseDocumentState = "ready" + DocumentsImportFrom200ResponseDocumentStateFailed DocumentsImportFrom200ResponseDocumentState = "failed" + DocumentsImportFrom200ResponseDocumentStateDeleting DocumentsImportFrom200ResponseDocumentState = "deleting" ) -func NewDocumentsInit200ResponseCreatedDocumentStateFromString(s string) (DocumentsInit200ResponseCreatedDocumentState, error) { +func NewDocumentsImportFrom200ResponseDocumentStateFromString(s string) (DocumentsImportFrom200ResponseDocumentState, error) { switch s { case "pending": - return DocumentsInit200ResponseCreatedDocumentStatePending, nil + return DocumentsImportFrom200ResponseDocumentStatePending, nil case "ready": - return DocumentsInit200ResponseCreatedDocumentStateReady, nil + return DocumentsImportFrom200ResponseDocumentStateReady, nil case "failed": - return DocumentsInit200ResponseCreatedDocumentStateFailed, nil + return DocumentsImportFrom200ResponseDocumentStateFailed, nil case "deleting": - return DocumentsInit200ResponseCreatedDocumentStateDeleting, nil + return DocumentsImportFrom200ResponseDocumentStateDeleting, nil } - var t DocumentsInit200ResponseCreatedDocumentState + var t DocumentsImportFrom200ResponseDocumentState return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (d DocumentsInit200ResponseCreatedDocumentState) Ptr() *DocumentsInit200ResponseCreatedDocumentState { +func (d DocumentsImportFrom200ResponseDocumentState) Ptr() *DocumentsImportFrom200ResponseDocumentState { return &d } -type DocumentsInit200ResponseCreatedDocumentThumbnailState string +type DocumentsImportFrom200ResponseDocumentThumbnailState string const ( - DocumentsInit200ResponseCreatedDocumentThumbnailStatePending DocumentsInit200ResponseCreatedDocumentThumbnailState = "pending" - DocumentsInit200ResponseCreatedDocumentThumbnailStateReady DocumentsInit200ResponseCreatedDocumentThumbnailState = "ready" - DocumentsInit200ResponseCreatedDocumentThumbnailStateLocked DocumentsInit200ResponseCreatedDocumentThumbnailState = "locked" - DocumentsInit200ResponseCreatedDocumentThumbnailStateFailed DocumentsInit200ResponseCreatedDocumentThumbnailState = "failed" + DocumentsImportFrom200ResponseDocumentThumbnailStatePending DocumentsImportFrom200ResponseDocumentThumbnailState = "pending" + DocumentsImportFrom200ResponseDocumentThumbnailStateReady DocumentsImportFrom200ResponseDocumentThumbnailState = "ready" + DocumentsImportFrom200ResponseDocumentThumbnailStateLocked DocumentsImportFrom200ResponseDocumentThumbnailState = "locked" + DocumentsImportFrom200ResponseDocumentThumbnailStateFailed DocumentsImportFrom200ResponseDocumentThumbnailState = "failed" ) -func NewDocumentsInit200ResponseCreatedDocumentThumbnailStateFromString(s string) (DocumentsInit200ResponseCreatedDocumentThumbnailState, error) { +func NewDocumentsImportFrom200ResponseDocumentThumbnailStateFromString(s string) (DocumentsImportFrom200ResponseDocumentThumbnailState, error) { switch s { case "pending": - return DocumentsInit200ResponseCreatedDocumentThumbnailStatePending, nil + return DocumentsImportFrom200ResponseDocumentThumbnailStatePending, nil case "ready": - return DocumentsInit200ResponseCreatedDocumentThumbnailStateReady, nil + return DocumentsImportFrom200ResponseDocumentThumbnailStateReady, nil case "locked": - return DocumentsInit200ResponseCreatedDocumentThumbnailStateLocked, nil + return DocumentsImportFrom200ResponseDocumentThumbnailStateLocked, nil case "failed": - return DocumentsInit200ResponseCreatedDocumentThumbnailStateFailed, nil + return DocumentsImportFrom200ResponseDocumentThumbnailStateFailed, nil } - var t DocumentsInit200ResponseCreatedDocumentThumbnailState + var t DocumentsImportFrom200ResponseDocumentThumbnailState return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (d DocumentsInit200ResponseCreatedDocumentThumbnailState) Ptr() *DocumentsInit200ResponseCreatedDocumentThumbnailState { +func (d DocumentsImportFrom200ResponseDocumentThumbnailState) Ptr() *DocumentsImportFrom200ResponseDocumentThumbnailState { return &d } -type DocumentsInit200ResponseCreatedUpload struct { - Kind string - Presigned *DocumentsInit200ResponseCreatedUploadPresigned - Proxy *DocumentsInit200ResponseCreatedUploadProxy +type DocumentsImportFrom200ResponseTag string + +const ( + DocumentsImportFrom200ResponseTagImported DocumentsImportFrom200ResponseTag = "imported" + DocumentsImportFrom200ResponseTagDeduped DocumentsImportFrom200ResponseTag = "deduped" + DocumentsImportFrom200ResponseTagAccepted DocumentsImportFrom200ResponseTag = "accepted" +) + +func NewDocumentsImportFrom200ResponseTagFromString(s string) (DocumentsImportFrom200ResponseTag, error) { + switch s { + case "imported": + return DocumentsImportFrom200ResponseTagImported, nil + case "deduped": + return DocumentsImportFrom200ResponseTagDeduped, nil + case "accepted": + return DocumentsImportFrom200ResponseTagAccepted, nil + } + var t DocumentsImportFrom200ResponseTag + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsImportFrom200ResponseTag) Ptr() *DocumentsImportFrom200ResponseTag { + return &d +} + +type DocumentsInit200Response struct { + Tag string + Created *DocumentsInit200ResponseCreated + Resumed *DocumentsInit200ResponseResumed + Deduped *DocumentsInit200ResponseDeduped rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseCreatedUpload) GetKind() string { +func (d *DocumentsInit200Response) GetTag() string { if d == nil { return "" } - return d.Kind + return d.Tag } -func (d *DocumentsInit200ResponseCreatedUpload) GetPresigned() *DocumentsInit200ResponseCreatedUploadPresigned { +func (d *DocumentsInit200Response) GetCreated() *DocumentsInit200ResponseCreated { if d == nil { return nil } - return d.Presigned + return d.Created } -func (d *DocumentsInit200ResponseCreatedUpload) GetProxy() *DocumentsInit200ResponseCreatedUploadProxy { +func (d *DocumentsInit200Response) GetResumed() *DocumentsInit200ResponseResumed { if d == nil { return nil } - return d.Proxy + return d.Resumed } -func (d *DocumentsInit200ResponseCreatedUpload) UnmarshalJSON(data []byte) error { +func (d *DocumentsInit200Response) GetDeduped() *DocumentsInit200ResponseDeduped { + if d == nil { + return nil + } + return d.Deduped +} + +func (d *DocumentsInit200Response) UnmarshalJSON(data []byte) error { var unmarshaler struct { - Kind string `json:"kind"` + Tag string `json:"tag"` } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - d.Kind = unmarshaler.Kind - if unmarshaler.Kind == "" { - return fmt.Errorf("%T did not include discriminant kind", d) + d.Tag = unmarshaler.Tag + if unmarshaler.Tag == "" { + return fmt.Errorf("%T did not include discriminant tag", d) } - switch unmarshaler.Kind { - case "presigned": - value := new(DocumentsInit200ResponseCreatedUploadPresigned) + switch unmarshaler.Tag { + case "created": + value := new(DocumentsInit200ResponseCreated) if err := json.Unmarshal(data, &value); err != nil { return err } - d.Presigned = value - case "proxy": - value := new(DocumentsInit200ResponseCreatedUploadProxy) + d.Created = value + case "resumed": + value := new(DocumentsInit200ResponseResumed) if err := json.Unmarshal(data, &value); err != nil { return err } - d.Proxy = value + d.Resumed = value + case "deduped": + value := new(DocumentsInit200ResponseDeduped) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + d.Deduped = value } d.rawJSON = json.RawMessage(data) return nil } -func (d DocumentsInit200ResponseCreatedUpload) MarshalJSON() ([]byte, error) { +func (d DocumentsInit200Response) MarshalJSON() ([]byte, error) { if err := d.validate(); err != nil { return nil, err } - if d.Presigned != nil { - return internal.MarshalJSONWithExtraProperty(d.Presigned, "kind", "presigned") + if d.Created != nil { + return internal.MarshalJSONWithExtraProperty(d.Created, "tag", "created") } - if d.Proxy != nil { - return internal.MarshalJSONWithExtraProperty(d.Proxy, "kind", "proxy") + if d.Resumed != nil { + return internal.MarshalJSONWithExtraProperty(d.Resumed, "tag", "resumed") + } + if d.Deduped != nil { + return internal.MarshalJSONWithExtraProperty(d.Deduped, "tag", "deduped") } if len(d.rawJSON) > 0 { return d.rawJSON, nil @@ -1868,51 +1869,58 @@ func (d DocumentsInit200ResponseCreatedUpload) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("type %T does not define a non-empty union type", d) } -type DocumentsInit200ResponseCreatedUploadVisitor interface { - VisitPresigned(*DocumentsInit200ResponseCreatedUploadPresigned) error - VisitProxy(*DocumentsInit200ResponseCreatedUploadProxy) error +type DocumentsInit200ResponseVisitor interface { + VisitCreated(*DocumentsInit200ResponseCreated) error + VisitResumed(*DocumentsInit200ResponseResumed) error + VisitDeduped(*DocumentsInit200ResponseDeduped) error } -func (d *DocumentsInit200ResponseCreatedUpload) Accept(visitor DocumentsInit200ResponseCreatedUploadVisitor) error { - if d.Presigned != nil { - return visitor.VisitPresigned(d.Presigned) +func (d *DocumentsInit200Response) Accept(visitor DocumentsInit200ResponseVisitor) error { + if d.Created != nil { + return visitor.VisitCreated(d.Created) } - if d.Proxy != nil { - return visitor.VisitProxy(d.Proxy) + if d.Resumed != nil { + return visitor.VisitResumed(d.Resumed) + } + if d.Deduped != nil { + return visitor.VisitDeduped(d.Deduped) } return fmt.Errorf("type %T does not define a non-empty union type", d) } -func (d *DocumentsInit200ResponseCreatedUpload) validate() error { +func (d *DocumentsInit200Response) validate() error { if d == nil { return fmt.Errorf("type %T is nil", d) } var fields []string - if d.Presigned != nil { - fields = append(fields, "presigned") + if d.Created != nil { + fields = append(fields, "created") } - if d.Proxy != nil { - fields = append(fields, "proxy") + if d.Resumed != nil { + fields = append(fields, "resumed") + } + if d.Deduped != nil { + fields = append(fields, "deduped") } if len(fields) == 0 { - if d.Kind != "" { + if d.Tag != "" { if len(d.rawJSON) > 0 { return nil } - return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", d, d.Kind) + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", d, d.Tag) } return fmt.Errorf("type %T is empty", d) } if len(fields) > 1 { return fmt.Errorf("type %T defines values for %s, but only one value is allowed", d, fields) } - if d.Kind != "" { + if d.Tag != "" { field := fields[0] - if d.Kind != field { + if d.Tag != field { return fmt.Errorf( "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", d, - d.Kind, + d.Tag, d, ) } @@ -1921,13 +1929,13 @@ func (d *DocumentsInit200ResponseCreatedUpload) validate() error { } var ( - documentsInit200ResponseCreatedUploadPresignedFieldPresigned = big.NewInt(1 << 0) - documentsInit200ResponseCreatedUploadPresignedFieldKey = big.NewInt(1 << 1) + documentsInit200ResponseCreatedFieldDocument = big.NewInt(1 << 0) + documentsInit200ResponseCreatedFieldUpload = big.NewInt(1 << 1) ) -type DocumentsInit200ResponseCreatedUploadPresigned struct { - Presigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned `json:"presigned" url:"presigned"` - Key string `json:"key" url:"key"` +type DocumentsInit200ResponseCreated struct { + Document *DocumentsInit200ResponseCreatedDocument `json:"document" url:"document"` + Upload *DocumentsInit200ResponseCreatedUpload `json:"upload" url:"upload"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -1936,55 +1944,55 @@ type DocumentsInit200ResponseCreatedUploadPresigned struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseCreatedUploadPresigned) GetPresigned() *DocumentsInit200ResponseCreatedUploadPresignedPresigned { +func (d *DocumentsInit200ResponseCreated) GetDocument() *DocumentsInit200ResponseCreatedDocument { if d == nil { return nil } - return d.Presigned + return d.Document } -func (d *DocumentsInit200ResponseCreatedUploadPresigned) GetKey() string { +func (d *DocumentsInit200ResponseCreated) GetUpload() *DocumentsInit200ResponseCreatedUpload { if d == nil { - return "" + return nil } - return d.Key + return d.Upload } -func (d *DocumentsInit200ResponseCreatedUploadPresigned) GetExtraProperties() map[string]interface{} { +func (d *DocumentsInit200ResponseCreated) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseCreatedUploadPresigned) require(field *big.Int) { +func (d *DocumentsInit200ResponseCreated) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetPresigned sets the Presigned field and marks it as non-optional; +// SetDocument sets the Document field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadPresigned) SetPresigned(presigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned) { - d.Presigned = presigned - d.require(documentsInit200ResponseCreatedUploadPresignedFieldPresigned) +func (d *DocumentsInit200ResponseCreated) SetDocument(document *DocumentsInit200ResponseCreatedDocument) { + d.Document = document + d.require(documentsInit200ResponseCreatedFieldDocument) } -// SetKey sets the Key field and marks it as non-optional; +// SetUpload sets the Upload field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadPresigned) SetKey(key string) { - d.Key = key - d.require(documentsInit200ResponseCreatedUploadPresignedFieldKey) +func (d *DocumentsInit200ResponseCreated) SetUpload(upload *DocumentsInit200ResponseCreatedUpload) { + d.Upload = upload + d.require(documentsInit200ResponseCreatedFieldUpload) } -func (d *DocumentsInit200ResponseCreatedUploadPresigned) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseCreatedUploadPresigned +func (d *DocumentsInit200ResponseCreated) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseCreated var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseCreatedUploadPresigned(value) + *d = DocumentsInit200ResponseCreated(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -1994,8 +2002,8 @@ func (d *DocumentsInit200ResponseCreatedUploadPresigned) UnmarshalJSON(data []by return nil } -func (d *DocumentsInit200ResponseCreatedUploadPresigned) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseCreatedUploadPresigned +func (d *DocumentsInit200ResponseCreated) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseCreated var marshaler = struct { embed }{ @@ -2005,7 +2013,7 @@ func (d *DocumentsInit200ResponseCreatedUploadPresigned) MarshalJSON() ([]byte, return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseCreatedUploadPresigned) String() string { +func (d *DocumentsInit200ResponseCreated) String() string { if d == nil { return "" } @@ -2021,17 +2029,35 @@ func (d *DocumentsInit200ResponseCreatedUploadPresigned) String() string { } var ( - documentsInit200ResponseCreatedUploadPresignedPresignedFieldURL = big.NewInt(1 << 0) - documentsInit200ResponseCreatedUploadPresignedPresignedFieldHeaders = big.NewInt(1 << 1) - documentsInit200ResponseCreatedUploadPresignedPresignedFieldMethod = big.NewInt(1 << 2) - documentsInit200ResponseCreatedUploadPresignedPresignedFieldExpiresAt = big.NewInt(1 << 3) + documentsInit200ResponseCreatedDocumentFieldID = big.NewInt(1 << 0) + documentsInit200ResponseCreatedDocumentFieldTenantID = big.NewInt(1 << 1) + documentsInit200ResponseCreatedDocumentFieldState = big.NewInt(1 << 2) + documentsInit200ResponseCreatedDocumentFieldBaseSha = big.NewInt(1 << 3) + documentsInit200ResponseCreatedDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) + documentsInit200ResponseCreatedDocumentFieldMetadata = big.NewInt(1 << 5) + documentsInit200ResponseCreatedDocumentFieldIdempotencyKey = big.NewInt(1 << 6) + documentsInit200ResponseCreatedDocumentFieldFailureReason = big.NewInt(1 << 7) + documentsInit200ResponseCreatedDocumentFieldThumbnailState = big.NewInt(1 << 8) + documentsInit200ResponseCreatedDocumentFieldThumbnailURL = big.NewInt(1 << 9) + documentsInit200ResponseCreatedDocumentFieldCreatedAt = big.NewInt(1 << 10) + documentsInit200ResponseCreatedDocumentFieldUpdatedAt = big.NewInt(1 << 11) + documentsInit200ResponseCreatedDocumentFieldCreatedBy = big.NewInt(1 << 12) ) -type DocumentsInit200ResponseCreatedUploadPresignedPresigned struct { - URL string `json:"url" url:"url"` - Headers map[string]string `json:"headers" url:"headers"` - Method DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod `json:"method" url:"method"` - ExpiresAt float64 `json:"expiresAt" url:"expiresAt"` +type DocumentsInit200ResponseCreatedDocument struct { + ID string `json:"id" url:"id"` + TenantID string `json:"tenantId" url:"tenantId"` + State DocumentsInit200ResponseCreatedDocumentState `json:"state" url:"state"` + BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` + StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` + Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` + FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` + ThumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` + ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` + CreatedAt float64 `json:"createdAt" url:"createdAt"` + UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -2040,83 +2066,209 @@ type DocumentsInit200ResponseCreatedUploadPresignedPresigned struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetURL() string { +func (d *DocumentsInit200ResponseCreatedDocument) GetID() string { if d == nil { return "" } - return d.URL + return d.ID } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetHeaders() map[string]string { +func (d *DocumentsInit200ResponseCreatedDocument) GetTenantID() string { if d == nil { - return nil + return "" } - return d.Headers + return d.TenantID } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetMethod() DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod { +func (d *DocumentsInit200ResponseCreatedDocument) GetState() DocumentsInit200ResponseCreatedDocumentState { if d == nil { return "" } - return d.Method + return d.State } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetExpiresAt() float64 { +func (d *DocumentsInit200ResponseCreatedDocument) GetBaseSha() *string { + if d == nil { + return nil + } + return d.BaseSha +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetStorageSizeBytes() *float64 { + if d == nil { + return nil + } + return d.StorageSizeBytes +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetMetadata() map[string]any { + if d == nil { + return nil + } + return d.Metadata +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetIdempotencyKey() *string { + if d == nil { + return nil + } + return d.IdempotencyKey +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetFailureReason() *string { + if d == nil { + return nil + } + return d.FailureReason +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetThumbnailState() *DocumentsInit200ResponseCreatedDocumentThumbnailState { + if d == nil { + return nil + } + return d.ThumbnailState +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetThumbnailURL() *string { + if d == nil { + return nil + } + return d.ThumbnailURL +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetCreatedAt() float64 { if d == nil { return 0 } - return d.ExpiresAt + return d.CreatedAt } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetExtraProperties() map[string]interface{} { +func (d *DocumentsInit200ResponseCreatedDocument) GetUpdatedAt() float64 { + if d == nil { + return 0 + } + return d.UpdatedAt +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetCreatedBy() *string { + if d == nil { + return nil + } + return d.CreatedBy +} + +func (d *DocumentsInit200ResponseCreatedDocument) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) require(field *big.Int) { +func (d *DocumentsInit200ResponseCreatedDocument) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetURL sets the URL field and marks it as non-optional; +// SetID sets the ID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetURL(url string) { - d.URL = url - d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldURL) +func (d *DocumentsInit200ResponseCreatedDocument) SetID(id string) { + d.ID = id + d.require(documentsInit200ResponseCreatedDocumentFieldID) } -// SetHeaders sets the Headers field and marks it as non-optional; +// SetTenantID sets the TenantID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetHeaders(headers map[string]string) { - d.Headers = headers - d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldHeaders) +func (d *DocumentsInit200ResponseCreatedDocument) SetTenantID(tenantID string) { + d.TenantID = tenantID + d.require(documentsInit200ResponseCreatedDocumentFieldTenantID) } -// SetMethod sets the Method field and marks it as non-optional; +// SetState sets the State field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetMethod(method DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod) { - d.Method = method - d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldMethod) +func (d *DocumentsInit200ResponseCreatedDocument) SetState(state DocumentsInit200ResponseCreatedDocumentState) { + d.State = state + d.require(documentsInit200ResponseCreatedDocumentFieldState) } -// SetExpiresAt sets the ExpiresAt field and marks it as non-optional; +// SetBaseSha sets the BaseSha field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetExpiresAt(expiresAt float64) { - d.ExpiresAt = expiresAt - d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldExpiresAt) +func (d *DocumentsInit200ResponseCreatedDocument) SetBaseSha(baseSha *string) { + d.BaseSha = baseSha + d.require(documentsInit200ResponseCreatedDocumentFieldBaseSha) } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseCreatedUploadPresignedPresigned +// SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetStorageSizeBytes(storageSizeBytes *float64) { + d.StorageSizeBytes = storageSizeBytes + d.require(documentsInit200ResponseCreatedDocumentFieldStorageSizeBytes) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetMetadata(metadata map[string]any) { + d.Metadata = metadata + d.require(documentsInit200ResponseCreatedDocumentFieldMetadata) +} + +// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetIdempotencyKey(idempotencyKey *string) { + d.IdempotencyKey = idempotencyKey + d.require(documentsInit200ResponseCreatedDocumentFieldIdempotencyKey) +} + +// SetFailureReason sets the FailureReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetFailureReason(failureReason *string) { + d.FailureReason = failureReason + d.require(documentsInit200ResponseCreatedDocumentFieldFailureReason) +} + +// SetThumbnailState sets the ThumbnailState field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetThumbnailState(thumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState) { + d.ThumbnailState = thumbnailState + d.require(documentsInit200ResponseCreatedDocumentFieldThumbnailState) +} + +// SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetThumbnailURL(thumbnailURL *string) { + d.ThumbnailURL = thumbnailURL + d.require(documentsInit200ResponseCreatedDocumentFieldThumbnailURL) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetCreatedAt(createdAt float64) { + d.CreatedAt = createdAt + d.require(documentsInit200ResponseCreatedDocumentFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetUpdatedAt(updatedAt float64) { + d.UpdatedAt = updatedAt + d.require(documentsInit200ResponseCreatedDocumentFieldUpdatedAt) +} + +// SetCreatedBy sets the CreatedBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedDocument) SetCreatedBy(createdBy *string) { + d.CreatedBy = createdBy + d.require(documentsInit200ResponseCreatedDocumentFieldCreatedBy) +} + +func (d *DocumentsInit200ResponseCreatedDocument) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseCreatedDocument var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseCreatedUploadPresignedPresigned(value) + *d = DocumentsInit200ResponseCreatedDocument(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -2126,8 +2278,8 @@ func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) UnmarshalJSON( return nil } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseCreatedUploadPresignedPresigned +func (d *DocumentsInit200ResponseCreatedDocument) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseCreatedDocument var marshaler = struct { embed }{ @@ -2137,7 +2289,7 @@ func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) MarshalJSON() return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) String() string { +func (d *DocumentsInit200ResponseCreatedDocument) String() string { if d == nil { return "" } @@ -2152,131 +2304,196 @@ func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) String() strin return fmt.Sprintf("%#v", d) } -type DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod string +type DocumentsInit200ResponseCreatedDocumentState string const ( - DocumentsInit200ResponseCreatedUploadPresignedPresignedMethodPut DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod = "PUT" + DocumentsInit200ResponseCreatedDocumentStatePending DocumentsInit200ResponseCreatedDocumentState = "pending" + DocumentsInit200ResponseCreatedDocumentStateReady DocumentsInit200ResponseCreatedDocumentState = "ready" + DocumentsInit200ResponseCreatedDocumentStateFailed DocumentsInit200ResponseCreatedDocumentState = "failed" + DocumentsInit200ResponseCreatedDocumentStateDeleting DocumentsInit200ResponseCreatedDocumentState = "deleting" ) -func NewDocumentsInit200ResponseCreatedUploadPresignedPresignedMethodFromString(s string) (DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod, error) { +func NewDocumentsInit200ResponseCreatedDocumentStateFromString(s string) (DocumentsInit200ResponseCreatedDocumentState, error) { switch s { - case "PUT": - return DocumentsInit200ResponseCreatedUploadPresignedPresignedMethodPut, nil - } - var t DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (d DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod) Ptr() *DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod { - return &d + case "pending": + return DocumentsInit200ResponseCreatedDocumentStatePending, nil + case "ready": + return DocumentsInit200ResponseCreatedDocumentStateReady, nil + case "failed": + return DocumentsInit200ResponseCreatedDocumentStateFailed, nil + case "deleting": + return DocumentsInit200ResponseCreatedDocumentStateDeleting, nil + } + var t DocumentsInit200ResponseCreatedDocumentState + return "", fmt.Errorf("%s is not a valid %T", s, t) } -var ( - documentsInit200ResponseCreatedUploadProxyFieldURL = big.NewInt(1 << 0) - documentsInit200ResponseCreatedUploadProxyFieldKey = big.NewInt(1 << 1) +func (d DocumentsInit200ResponseCreatedDocumentState) Ptr() *DocumentsInit200ResponseCreatedDocumentState { + return &d +} + +type DocumentsInit200ResponseCreatedDocumentThumbnailState string + +const ( + DocumentsInit200ResponseCreatedDocumentThumbnailStatePending DocumentsInit200ResponseCreatedDocumentThumbnailState = "pending" + DocumentsInit200ResponseCreatedDocumentThumbnailStateReady DocumentsInit200ResponseCreatedDocumentThumbnailState = "ready" + DocumentsInit200ResponseCreatedDocumentThumbnailStateLocked DocumentsInit200ResponseCreatedDocumentThumbnailState = "locked" + DocumentsInit200ResponseCreatedDocumentThumbnailStateFailed DocumentsInit200ResponseCreatedDocumentThumbnailState = "failed" ) -type DocumentsInit200ResponseCreatedUploadProxy struct { - URL string `json:"url" url:"url"` - Key string `json:"key" url:"key"` +func NewDocumentsInit200ResponseCreatedDocumentThumbnailStateFromString(s string) (DocumentsInit200ResponseCreatedDocumentThumbnailState, error) { + switch s { + case "pending": + return DocumentsInit200ResponseCreatedDocumentThumbnailStatePending, nil + case "ready": + return DocumentsInit200ResponseCreatedDocumentThumbnailStateReady, nil + case "locked": + return DocumentsInit200ResponseCreatedDocumentThumbnailStateLocked, nil + case "failed": + return DocumentsInit200ResponseCreatedDocumentThumbnailStateFailed, nil + } + var t DocumentsInit200ResponseCreatedDocumentThumbnailState + return "", fmt.Errorf("%s is not a valid %T", s, t) +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (d DocumentsInit200ResponseCreatedDocumentThumbnailState) Ptr() *DocumentsInit200ResponseCreatedDocumentThumbnailState { + return &d +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +type DocumentsInit200ResponseCreatedUpload struct { + Kind string + Presigned *DocumentsInit200ResponseCreatedUploadPresigned + Proxy *DocumentsInit200ResponseCreatedUploadProxy + + rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseCreatedUploadProxy) GetURL() string { +func (d *DocumentsInit200ResponseCreatedUpload) GetKind() string { if d == nil { return "" } - return d.URL + return d.Kind } -func (d *DocumentsInit200ResponseCreatedUploadProxy) GetKey() string { +func (d *DocumentsInit200ResponseCreatedUpload) GetPresigned() *DocumentsInit200ResponseCreatedUploadPresigned { if d == nil { - return "" + return nil } - return d.Key + return d.Presigned } -func (d *DocumentsInit200ResponseCreatedUploadProxy) GetExtraProperties() map[string]interface{} { +func (d *DocumentsInit200ResponseCreatedUpload) GetProxy() *DocumentsInit200ResponseCreatedUploadProxy { if d == nil { return nil } - return d.extraProperties + return d.Proxy } -func (d *DocumentsInit200ResponseCreatedUploadProxy) require(field *big.Int) { - if d.explicitFields == nil { - d.explicitFields = big.NewInt(0) +func (d *DocumentsInit200ResponseCreatedUpload) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + Kind string `json:"kind"` } - d.explicitFields.Or(d.explicitFields, field) -} - -// SetURL sets the URL field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadProxy) SetURL(url string) { - d.URL = url - d.require(documentsInit200ResponseCreatedUploadProxyFieldURL) -} - -// SetKey sets the Key field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseCreatedUploadProxy) SetKey(key string) { - d.Key = key - d.require(documentsInit200ResponseCreatedUploadProxyFieldKey) -} - -func (d *DocumentsInit200ResponseCreatedUploadProxy) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseCreatedUploadProxy - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *d = DocumentsInit200ResponseCreatedUploadProxy(value) - extraProperties, err := internal.ExtractExtraProperties(data, *d) - if err != nil { - return err + d.Kind = unmarshaler.Kind + if unmarshaler.Kind == "" { + return fmt.Errorf("%T did not include discriminant kind", d) + } + switch unmarshaler.Kind { + case "presigned": + value := new(DocumentsInit200ResponseCreatedUploadPresigned) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + d.Presigned = value + case "proxy": + value := new(DocumentsInit200ResponseCreatedUploadProxy) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + d.Proxy = value } - d.extraProperties = extraProperties d.rawJSON = json.RawMessage(data) return nil } -func (d *DocumentsInit200ResponseCreatedUploadProxy) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseCreatedUploadProxy - var marshaler = struct { - embed - }{ - embed: embed(*d), +func (d DocumentsInit200ResponseCreatedUpload) MarshalJSON() ([]byte, error) { + if err := d.validate(); err != nil { + return nil, err } - explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) - return json.Marshal(explicitMarshaler) + if d.Presigned != nil { + return internal.MarshalJSONWithExtraProperty(d.Presigned, "kind", "presigned") + } + if d.Proxy != nil { + return internal.MarshalJSONWithExtraProperty(d.Proxy, "kind", "proxy") + } + if len(d.rawJSON) > 0 { + return d.rawJSON, nil + } + return nil, fmt.Errorf("type %T does not define a non-empty union type", d) } -func (d *DocumentsInit200ResponseCreatedUploadProxy) String() string { +type DocumentsInit200ResponseCreatedUploadVisitor interface { + VisitPresigned(*DocumentsInit200ResponseCreatedUploadPresigned) error + VisitProxy(*DocumentsInit200ResponseCreatedUploadProxy) error +} + +func (d *DocumentsInit200ResponseCreatedUpload) Accept(visitor DocumentsInit200ResponseCreatedUploadVisitor) error { + if d.Presigned != nil { + return visitor.VisitPresigned(d.Presigned) + } + if d.Proxy != nil { + return visitor.VisitProxy(d.Proxy) + } + return fmt.Errorf("type %T does not define a non-empty union type", d) +} + +func (d *DocumentsInit200ResponseCreatedUpload) validate() error { if d == nil { - return "" + return fmt.Errorf("type %T is nil", d) } - if len(d.rawJSON) > 0 { - if value, err := internal.StringifyJSON(d.rawJSON); err == nil { - return value + var fields []string + if d.Presigned != nil { + fields = append(fields, "presigned") + } + if d.Proxy != nil { + fields = append(fields, "proxy") + } + if len(fields) == 0 { + if d.Kind != "" { + if len(d.rawJSON) > 0 { + return nil + } + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", d, d.Kind) } + return fmt.Errorf("type %T is empty", d) } - if value, err := internal.StringifyJSON(d); err == nil { - return value + if len(fields) > 1 { + return fmt.Errorf("type %T defines values for %s, but only one value is allowed", d, fields) } - return fmt.Sprintf("%#v", d) + if d.Kind != "" { + field := fields[0] + if d.Kind != field { + return fmt.Errorf( + "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", + d, + d.Kind, + d, + ) + } + } + return nil } var ( - documentsInit200ResponseDedupedFieldDocument = big.NewInt(1 << 0) + documentsInit200ResponseCreatedUploadPresignedFieldPresigned = big.NewInt(1 << 0) + documentsInit200ResponseCreatedUploadPresignedFieldKey = big.NewInt(1 << 1) ) -type DocumentsInit200ResponseDeduped struct { - Document *DocumentsInit200ResponseDedupedDocument `json:"document" url:"document"` +type DocumentsInit200ResponseCreatedUploadPresigned struct { + Presigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned `json:"presigned" url:"presigned"` + Key string `json:"key" url:"key"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -2285,41 +2502,55 @@ type DocumentsInit200ResponseDeduped struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseDeduped) GetDocument() *DocumentsInit200ResponseDedupedDocument { +func (d *DocumentsInit200ResponseCreatedUploadPresigned) GetPresigned() *DocumentsInit200ResponseCreatedUploadPresignedPresigned { if d == nil { return nil } - return d.Document + return d.Presigned } -func (d *DocumentsInit200ResponseDeduped) GetExtraProperties() map[string]interface{} { +func (d *DocumentsInit200ResponseCreatedUploadPresigned) GetKey() string { + if d == nil { + return "" + } + return d.Key +} + +func (d *DocumentsInit200ResponseCreatedUploadPresigned) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseDeduped) require(field *big.Int) { +func (d *DocumentsInit200ResponseCreatedUploadPresigned) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetDocument sets the Document field and marks it as non-optional; +// SetPresigned sets the Presigned field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDeduped) SetDocument(document *DocumentsInit200ResponseDedupedDocument) { - d.Document = document - d.require(documentsInit200ResponseDedupedFieldDocument) +func (d *DocumentsInit200ResponseCreatedUploadPresigned) SetPresigned(presigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned) { + d.Presigned = presigned + d.require(documentsInit200ResponseCreatedUploadPresignedFieldPresigned) } -func (d *DocumentsInit200ResponseDeduped) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseDeduped +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedUploadPresigned) SetKey(key string) { + d.Key = key + d.require(documentsInit200ResponseCreatedUploadPresignedFieldKey) +} + +func (d *DocumentsInit200ResponseCreatedUploadPresigned) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseCreatedUploadPresigned var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseDeduped(value) + *d = DocumentsInit200ResponseCreatedUploadPresigned(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -2329,8 +2560,8 @@ func (d *DocumentsInit200ResponseDeduped) UnmarshalJSON(data []byte) error { return nil } -func (d *DocumentsInit200ResponseDeduped) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseDeduped +func (d *DocumentsInit200ResponseCreatedUploadPresigned) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseCreatedUploadPresigned var marshaler = struct { embed }{ @@ -2340,7 +2571,7 @@ func (d *DocumentsInit200ResponseDeduped) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseDeduped) String() string { +func (d *DocumentsInit200ResponseCreatedUploadPresigned) String() string { if d == nil { return "" } @@ -2356,35 +2587,17 @@ func (d *DocumentsInit200ResponseDeduped) String() string { } var ( - documentsInit200ResponseDedupedDocumentFieldID = big.NewInt(1 << 0) - documentsInit200ResponseDedupedDocumentFieldTenantID = big.NewInt(1 << 1) - documentsInit200ResponseDedupedDocumentFieldState = big.NewInt(1 << 2) - documentsInit200ResponseDedupedDocumentFieldBaseSha = big.NewInt(1 << 3) - documentsInit200ResponseDedupedDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) - documentsInit200ResponseDedupedDocumentFieldMetadata = big.NewInt(1 << 5) - documentsInit200ResponseDedupedDocumentFieldIdempotencyKey = big.NewInt(1 << 6) - documentsInit200ResponseDedupedDocumentFieldFailureReason = big.NewInt(1 << 7) - documentsInit200ResponseDedupedDocumentFieldThumbnailState = big.NewInt(1 << 8) - documentsInit200ResponseDedupedDocumentFieldThumbnailURL = big.NewInt(1 << 9) - documentsInit200ResponseDedupedDocumentFieldCreatedAt = big.NewInt(1 << 10) - documentsInit200ResponseDedupedDocumentFieldUpdatedAt = big.NewInt(1 << 11) - documentsInit200ResponseDedupedDocumentFieldCreatedBy = big.NewInt(1 << 12) + documentsInit200ResponseCreatedUploadPresignedPresignedFieldURL = big.NewInt(1 << 0) + documentsInit200ResponseCreatedUploadPresignedPresignedFieldHeaders = big.NewInt(1 << 1) + documentsInit200ResponseCreatedUploadPresignedPresignedFieldMethod = big.NewInt(1 << 2) + documentsInit200ResponseCreatedUploadPresignedPresignedFieldExpiresAt = big.NewInt(1 << 3) ) -type DocumentsInit200ResponseDedupedDocument struct { - ID string `json:"id" url:"id"` - TenantID string `json:"tenantId" url:"tenantId"` - State DocumentsInit200ResponseDedupedDocumentState `json:"state" url:"state"` - BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` - StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` - Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` - IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` - FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` - ThumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` - ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` - CreatedAt float64 `json:"createdAt" url:"createdAt"` - UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` - CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` +type DocumentsInit200ResponseCreatedUploadPresignedPresigned struct { + URL string `json:"url" url:"url"` + Headers map[string]string `json:"headers" url:"headers"` + Method DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod `json:"method" url:"method"` + ExpiresAt float64 `json:"expiresAt" url:"expiresAt"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -2393,209 +2606,83 @@ type DocumentsInit200ResponseDedupedDocument struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseDedupedDocument) GetID() string { - if d == nil { - return "" - } - return d.ID -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetTenantID() string { - if d == nil { - return "" - } - return d.TenantID -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetState() DocumentsInit200ResponseDedupedDocumentState { +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetURL() string { if d == nil { return "" } - return d.State -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetBaseSha() *string { - if d == nil { - return nil - } - return d.BaseSha -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetStorageSizeBytes() *float64 { - if d == nil { - return nil - } - return d.StorageSizeBytes -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetMetadata() map[string]any { - if d == nil { - return nil - } - return d.Metadata -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetIdempotencyKey() *string { - if d == nil { - return nil - } - return d.IdempotencyKey -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetFailureReason() *string { - if d == nil { - return nil - } - return d.FailureReason -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetThumbnailState() *DocumentsInit200ResponseDedupedDocumentThumbnailState { - if d == nil { - return nil - } - return d.ThumbnailState + return d.URL } -func (d *DocumentsInit200ResponseDedupedDocument) GetThumbnailURL() *string { +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetHeaders() map[string]string { if d == nil { return nil } - return d.ThumbnailURL + return d.Headers } -func (d *DocumentsInit200ResponseDedupedDocument) GetCreatedAt() float64 { +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetMethod() DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod { if d == nil { - return 0 + return "" } - return d.CreatedAt + return d.Method } -func (d *DocumentsInit200ResponseDedupedDocument) GetUpdatedAt() float64 { +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetExpiresAt() float64 { if d == nil { return 0 } - return d.UpdatedAt -} - -func (d *DocumentsInit200ResponseDedupedDocument) GetCreatedBy() *string { - if d == nil { - return nil - } - return d.CreatedBy + return d.ExpiresAt } -func (d *DocumentsInit200ResponseDedupedDocument) GetExtraProperties() map[string]interface{} { +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseDedupedDocument) require(field *big.Int) { +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetID sets the ID field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetID(id string) { - d.ID = id - d.require(documentsInit200ResponseDedupedDocumentFieldID) -} - -// SetTenantID sets the TenantID field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetTenantID(tenantID string) { - d.TenantID = tenantID - d.require(documentsInit200ResponseDedupedDocumentFieldTenantID) -} - -// SetState sets the State field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetState(state DocumentsInit200ResponseDedupedDocumentState) { - d.State = state - d.require(documentsInit200ResponseDedupedDocumentFieldState) -} - -// SetBaseSha sets the BaseSha field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetBaseSha(baseSha *string) { - d.BaseSha = baseSha - d.require(documentsInit200ResponseDedupedDocumentFieldBaseSha) -} - -// SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetStorageSizeBytes(storageSizeBytes *float64) { - d.StorageSizeBytes = storageSizeBytes - d.require(documentsInit200ResponseDedupedDocumentFieldStorageSizeBytes) -} - -// SetMetadata sets the Metadata field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetMetadata(metadata map[string]any) { - d.Metadata = metadata - d.require(documentsInit200ResponseDedupedDocumentFieldMetadata) -} - -// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetIdempotencyKey(idempotencyKey *string) { - d.IdempotencyKey = idempotencyKey - d.require(documentsInit200ResponseDedupedDocumentFieldIdempotencyKey) -} - -// SetFailureReason sets the FailureReason field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetFailureReason(failureReason *string) { - d.FailureReason = failureReason - d.require(documentsInit200ResponseDedupedDocumentFieldFailureReason) -} - -// SetThumbnailState sets the ThumbnailState field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetThumbnailState(thumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState) { - d.ThumbnailState = thumbnailState - d.require(documentsInit200ResponseDedupedDocumentFieldThumbnailState) -} - -// SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; +// SetURL sets the URL field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetThumbnailURL(thumbnailURL *string) { - d.ThumbnailURL = thumbnailURL - d.require(documentsInit200ResponseDedupedDocumentFieldThumbnailURL) +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetURL(url string) { + d.URL = url + d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldURL) } -// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// SetHeaders sets the Headers field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetCreatedAt(createdAt float64) { - d.CreatedAt = createdAt - d.require(documentsInit200ResponseDedupedDocumentFieldCreatedAt) +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetHeaders(headers map[string]string) { + d.Headers = headers + d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldHeaders) } -// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// SetMethod sets the Method field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetUpdatedAt(updatedAt float64) { - d.UpdatedAt = updatedAt - d.require(documentsInit200ResponseDedupedDocumentFieldUpdatedAt) +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetMethod(method DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod) { + d.Method = method + d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldMethod) } -// SetCreatedBy sets the CreatedBy field and marks it as non-optional; +// SetExpiresAt sets the ExpiresAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseDedupedDocument) SetCreatedBy(createdBy *string) { - d.CreatedBy = createdBy - d.require(documentsInit200ResponseDedupedDocumentFieldCreatedBy) +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) SetExpiresAt(expiresAt float64) { + d.ExpiresAt = expiresAt + d.require(documentsInit200ResponseCreatedUploadPresignedPresignedFieldExpiresAt) } -func (d *DocumentsInit200ResponseDedupedDocument) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseDedupedDocument +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseCreatedUploadPresignedPresigned var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseDedupedDocument(value) + *d = DocumentsInit200ResponseCreatedUploadPresignedPresigned(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -2605,8 +2692,8 @@ func (d *DocumentsInit200ResponseDedupedDocument) UnmarshalJSON(data []byte) err return nil } -func (d *DocumentsInit200ResponseDedupedDocument) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseDedupedDocument +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseCreatedUploadPresignedPresigned var marshaler = struct { embed }{ @@ -2616,7 +2703,7 @@ func (d *DocumentsInit200ResponseDedupedDocument) MarshalJSON() ([]byte, error) return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseDedupedDocument) String() string { +func (d *DocumentsInit200ResponseCreatedUploadPresignedPresigned) String() string { if d == nil { return "" } @@ -2631,70 +2718,131 @@ func (d *DocumentsInit200ResponseDedupedDocument) String() string { return fmt.Sprintf("%#v", d) } -type DocumentsInit200ResponseDedupedDocumentState string +type DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod string const ( - DocumentsInit200ResponseDedupedDocumentStatePending DocumentsInit200ResponseDedupedDocumentState = "pending" - DocumentsInit200ResponseDedupedDocumentStateReady DocumentsInit200ResponseDedupedDocumentState = "ready" - DocumentsInit200ResponseDedupedDocumentStateFailed DocumentsInit200ResponseDedupedDocumentState = "failed" - DocumentsInit200ResponseDedupedDocumentStateDeleting DocumentsInit200ResponseDedupedDocumentState = "deleting" + DocumentsInit200ResponseCreatedUploadPresignedPresignedMethodPut DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod = "PUT" ) -func NewDocumentsInit200ResponseDedupedDocumentStateFromString(s string) (DocumentsInit200ResponseDedupedDocumentState, error) { +func NewDocumentsInit200ResponseCreatedUploadPresignedPresignedMethodFromString(s string) (DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod, error) { switch s { - case "pending": - return DocumentsInit200ResponseDedupedDocumentStatePending, nil - case "ready": - return DocumentsInit200ResponseDedupedDocumentStateReady, nil - case "failed": - return DocumentsInit200ResponseDedupedDocumentStateFailed, nil - case "deleting": - return DocumentsInit200ResponseDedupedDocumentStateDeleting, nil + case "PUT": + return DocumentsInit200ResponseCreatedUploadPresignedPresignedMethodPut, nil } - var t DocumentsInit200ResponseDedupedDocumentState + var t DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (d DocumentsInit200ResponseDedupedDocumentState) Ptr() *DocumentsInit200ResponseDedupedDocumentState { +func (d DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod) Ptr() *DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod { return &d } -type DocumentsInit200ResponseDedupedDocumentThumbnailState string - -const ( - DocumentsInit200ResponseDedupedDocumentThumbnailStatePending DocumentsInit200ResponseDedupedDocumentThumbnailState = "pending" - DocumentsInit200ResponseDedupedDocumentThumbnailStateReady DocumentsInit200ResponseDedupedDocumentThumbnailState = "ready" - DocumentsInit200ResponseDedupedDocumentThumbnailStateLocked DocumentsInit200ResponseDedupedDocumentThumbnailState = "locked" - DocumentsInit200ResponseDedupedDocumentThumbnailStateFailed DocumentsInit200ResponseDedupedDocumentThumbnailState = "failed" +var ( + documentsInit200ResponseCreatedUploadProxyFieldURL = big.NewInt(1 << 0) + documentsInit200ResponseCreatedUploadProxyFieldKey = big.NewInt(1 << 1) ) -func NewDocumentsInit200ResponseDedupedDocumentThumbnailStateFromString(s string) (DocumentsInit200ResponseDedupedDocumentThumbnailState, error) { - switch s { - case "pending": - return DocumentsInit200ResponseDedupedDocumentThumbnailStatePending, nil - case "ready": - return DocumentsInit200ResponseDedupedDocumentThumbnailStateReady, nil - case "locked": - return DocumentsInit200ResponseDedupedDocumentThumbnailStateLocked, nil - case "failed": - return DocumentsInit200ResponseDedupedDocumentThumbnailStateFailed, nil +type DocumentsInit200ResponseCreatedUploadProxy struct { + URL string `json:"url" url:"url"` + Key string `json:"key" url:"key"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsInit200ResponseCreatedUploadProxy) GetURL() string { + if d == nil { + return "" } - var t DocumentsInit200ResponseDedupedDocumentThumbnailState - return "", fmt.Errorf("%s is not a valid %T", s, t) + return d.URL } -func (d DocumentsInit200ResponseDedupedDocumentThumbnailState) Ptr() *DocumentsInit200ResponseDedupedDocumentThumbnailState { - return &d +func (d *DocumentsInit200ResponseCreatedUploadProxy) GetKey() string { + if d == nil { + return "" + } + return d.Key +} + +func (d *DocumentsInit200ResponseCreatedUploadProxy) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsInit200ResponseCreatedUploadProxy) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetURL sets the URL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedUploadProxy) SetURL(url string) { + d.URL = url + d.require(documentsInit200ResponseCreatedUploadProxyFieldURL) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseCreatedUploadProxy) SetKey(key string) { + d.Key = key + d.require(documentsInit200ResponseCreatedUploadProxyFieldKey) +} + +func (d *DocumentsInit200ResponseCreatedUploadProxy) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseCreatedUploadProxy + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsInit200ResponseCreatedUploadProxy(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsInit200ResponseCreatedUploadProxy) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseCreatedUploadProxy + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsInit200ResponseCreatedUploadProxy) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) } var ( - documentsInit200ResponseResumedFieldDocument = big.NewInt(1 << 0) - documentsInit200ResponseResumedFieldUpload = big.NewInt(1 << 1) + documentsInit200ResponseDedupedFieldDocument = big.NewInt(1 << 0) ) -type DocumentsInit200ResponseResumed struct { - Document *DocumentsInit200ResponseResumedDocument `json:"document" url:"document"` - Upload *DocumentsInit200ResponseResumedUpload `json:"upload" url:"upload"` +type DocumentsInit200ResponseDeduped struct { + Document *DocumentsInit200ResponseDedupedDocument `json:"document" url:"document"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -2703,28 +2851,21 @@ type DocumentsInit200ResponseResumed struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseResumed) GetDocument() *DocumentsInit200ResponseResumedDocument { +func (d *DocumentsInit200ResponseDeduped) GetDocument() *DocumentsInit200ResponseDedupedDocument { if d == nil { return nil } return d.Document } -func (d *DocumentsInit200ResponseResumed) GetUpload() *DocumentsInit200ResponseResumedUpload { - if d == nil { - return nil - } - return d.Upload -} - -func (d *DocumentsInit200ResponseResumed) GetExtraProperties() map[string]interface{} { +func (d *DocumentsInit200ResponseDeduped) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseResumed) require(field *big.Int) { +func (d *DocumentsInit200ResponseDeduped) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } @@ -2733,25 +2874,18 @@ func (d *DocumentsInit200ResponseResumed) require(field *big.Int) { // SetDocument sets the Document field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumed) SetDocument(document *DocumentsInit200ResponseResumedDocument) { +func (d *DocumentsInit200ResponseDeduped) SetDocument(document *DocumentsInit200ResponseDedupedDocument) { d.Document = document - d.require(documentsInit200ResponseResumedFieldDocument) -} - -// SetUpload sets the Upload field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumed) SetUpload(upload *DocumentsInit200ResponseResumedUpload) { - d.Upload = upload - d.require(documentsInit200ResponseResumedFieldUpload) + d.require(documentsInit200ResponseDedupedFieldDocument) } -func (d *DocumentsInit200ResponseResumed) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseResumed +func (d *DocumentsInit200ResponseDeduped) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseDeduped var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseResumed(value) + *d = DocumentsInit200ResponseDeduped(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -2761,8 +2895,8 @@ func (d *DocumentsInit200ResponseResumed) UnmarshalJSON(data []byte) error { return nil } -func (d *DocumentsInit200ResponseResumed) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseResumed +func (d *DocumentsInit200ResponseDeduped) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseDeduped var marshaler = struct { embed }{ @@ -2772,7 +2906,7 @@ func (d *DocumentsInit200ResponseResumed) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseResumed) String() string { +func (d *DocumentsInit200ResponseDeduped) String() string { if d == nil { return "" } @@ -2788,31 +2922,31 @@ func (d *DocumentsInit200ResponseResumed) String() string { } var ( - documentsInit200ResponseResumedDocumentFieldID = big.NewInt(1 << 0) - documentsInit200ResponseResumedDocumentFieldTenantID = big.NewInt(1 << 1) - documentsInit200ResponseResumedDocumentFieldState = big.NewInt(1 << 2) - documentsInit200ResponseResumedDocumentFieldBaseSha = big.NewInt(1 << 3) - documentsInit200ResponseResumedDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) - documentsInit200ResponseResumedDocumentFieldMetadata = big.NewInt(1 << 5) - documentsInit200ResponseResumedDocumentFieldIdempotencyKey = big.NewInt(1 << 6) - documentsInit200ResponseResumedDocumentFieldFailureReason = big.NewInt(1 << 7) - documentsInit200ResponseResumedDocumentFieldThumbnailState = big.NewInt(1 << 8) - documentsInit200ResponseResumedDocumentFieldThumbnailURL = big.NewInt(1 << 9) - documentsInit200ResponseResumedDocumentFieldCreatedAt = big.NewInt(1 << 10) - documentsInit200ResponseResumedDocumentFieldUpdatedAt = big.NewInt(1 << 11) - documentsInit200ResponseResumedDocumentFieldCreatedBy = big.NewInt(1 << 12) + documentsInit200ResponseDedupedDocumentFieldID = big.NewInt(1 << 0) + documentsInit200ResponseDedupedDocumentFieldTenantID = big.NewInt(1 << 1) + documentsInit200ResponseDedupedDocumentFieldState = big.NewInt(1 << 2) + documentsInit200ResponseDedupedDocumentFieldBaseSha = big.NewInt(1 << 3) + documentsInit200ResponseDedupedDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) + documentsInit200ResponseDedupedDocumentFieldMetadata = big.NewInt(1 << 5) + documentsInit200ResponseDedupedDocumentFieldIdempotencyKey = big.NewInt(1 << 6) + documentsInit200ResponseDedupedDocumentFieldFailureReason = big.NewInt(1 << 7) + documentsInit200ResponseDedupedDocumentFieldThumbnailState = big.NewInt(1 << 8) + documentsInit200ResponseDedupedDocumentFieldThumbnailURL = big.NewInt(1 << 9) + documentsInit200ResponseDedupedDocumentFieldCreatedAt = big.NewInt(1 << 10) + documentsInit200ResponseDedupedDocumentFieldUpdatedAt = big.NewInt(1 << 11) + documentsInit200ResponseDedupedDocumentFieldCreatedBy = big.NewInt(1 << 12) ) -type DocumentsInit200ResponseResumedDocument struct { +type DocumentsInit200ResponseDedupedDocument struct { ID string `json:"id" url:"id"` TenantID string `json:"tenantId" url:"tenantId"` - State DocumentsInit200ResponseResumedDocumentState `json:"state" url:"state"` + State DocumentsInit200ResponseDedupedDocumentState `json:"state" url:"state"` BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` - ThumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` + ThumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` CreatedAt float64 `json:"createdAt" url:"createdAt"` UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` @@ -2825,105 +2959,105 @@ type DocumentsInit200ResponseResumedDocument struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseResumedDocument) GetID() string { +func (d *DocumentsInit200ResponseDedupedDocument) GetID() string { if d == nil { return "" } return d.ID } -func (d *DocumentsInit200ResponseResumedDocument) GetTenantID() string { +func (d *DocumentsInit200ResponseDedupedDocument) GetTenantID() string { if d == nil { return "" } return d.TenantID } -func (d *DocumentsInit200ResponseResumedDocument) GetState() DocumentsInit200ResponseResumedDocumentState { +func (d *DocumentsInit200ResponseDedupedDocument) GetState() DocumentsInit200ResponseDedupedDocumentState { if d == nil { return "" } return d.State } -func (d *DocumentsInit200ResponseResumedDocument) GetBaseSha() *string { +func (d *DocumentsInit200ResponseDedupedDocument) GetBaseSha() *string { if d == nil { return nil } return d.BaseSha } -func (d *DocumentsInit200ResponseResumedDocument) GetStorageSizeBytes() *float64 { +func (d *DocumentsInit200ResponseDedupedDocument) GetStorageSizeBytes() *float64 { if d == nil { return nil } return d.StorageSizeBytes } -func (d *DocumentsInit200ResponseResumedDocument) GetMetadata() map[string]any { +func (d *DocumentsInit200ResponseDedupedDocument) GetMetadata() map[string]any { if d == nil { return nil } return d.Metadata } -func (d *DocumentsInit200ResponseResumedDocument) GetIdempotencyKey() *string { +func (d *DocumentsInit200ResponseDedupedDocument) GetIdempotencyKey() *string { if d == nil { return nil } return d.IdempotencyKey } -func (d *DocumentsInit200ResponseResumedDocument) GetFailureReason() *string { +func (d *DocumentsInit200ResponseDedupedDocument) GetFailureReason() *string { if d == nil { return nil } return d.FailureReason } -func (d *DocumentsInit200ResponseResumedDocument) GetThumbnailState() *DocumentsInit200ResponseResumedDocumentThumbnailState { +func (d *DocumentsInit200ResponseDedupedDocument) GetThumbnailState() *DocumentsInit200ResponseDedupedDocumentThumbnailState { if d == nil { return nil } return d.ThumbnailState } -func (d *DocumentsInit200ResponseResumedDocument) GetThumbnailURL() *string { +func (d *DocumentsInit200ResponseDedupedDocument) GetThumbnailURL() *string { if d == nil { return nil } return d.ThumbnailURL } -func (d *DocumentsInit200ResponseResumedDocument) GetCreatedAt() float64 { +func (d *DocumentsInit200ResponseDedupedDocument) GetCreatedAt() float64 { if d == nil { return 0 } return d.CreatedAt } -func (d *DocumentsInit200ResponseResumedDocument) GetUpdatedAt() float64 { +func (d *DocumentsInit200ResponseDedupedDocument) GetUpdatedAt() float64 { if d == nil { return 0 } return d.UpdatedAt } -func (d *DocumentsInit200ResponseResumedDocument) GetCreatedBy() *string { +func (d *DocumentsInit200ResponseDedupedDocument) GetCreatedBy() *string { if d == nil { return nil } return d.CreatedBy } -func (d *DocumentsInit200ResponseResumedDocument) GetExtraProperties() map[string]interface{} { +func (d *DocumentsInit200ResponseDedupedDocument) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseResumedDocument) require(field *big.Int) { +func (d *DocumentsInit200ResponseDedupedDocument) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } @@ -2932,102 +3066,102 @@ func (d *DocumentsInit200ResponseResumedDocument) require(field *big.Int) { // SetID sets the ID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetID(id string) { +func (d *DocumentsInit200ResponseDedupedDocument) SetID(id string) { d.ID = id - d.require(documentsInit200ResponseResumedDocumentFieldID) + d.require(documentsInit200ResponseDedupedDocumentFieldID) } // SetTenantID sets the TenantID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetTenantID(tenantID string) { +func (d *DocumentsInit200ResponseDedupedDocument) SetTenantID(tenantID string) { d.TenantID = tenantID - d.require(documentsInit200ResponseResumedDocumentFieldTenantID) + d.require(documentsInit200ResponseDedupedDocumentFieldTenantID) } // SetState sets the State field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetState(state DocumentsInit200ResponseResumedDocumentState) { +func (d *DocumentsInit200ResponseDedupedDocument) SetState(state DocumentsInit200ResponseDedupedDocumentState) { d.State = state - d.require(documentsInit200ResponseResumedDocumentFieldState) + d.require(documentsInit200ResponseDedupedDocumentFieldState) } // SetBaseSha sets the BaseSha field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetBaseSha(baseSha *string) { +func (d *DocumentsInit200ResponseDedupedDocument) SetBaseSha(baseSha *string) { d.BaseSha = baseSha - d.require(documentsInit200ResponseResumedDocumentFieldBaseSha) + d.require(documentsInit200ResponseDedupedDocumentFieldBaseSha) } // SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetStorageSizeBytes(storageSizeBytes *float64) { +func (d *DocumentsInit200ResponseDedupedDocument) SetStorageSizeBytes(storageSizeBytes *float64) { d.StorageSizeBytes = storageSizeBytes - d.require(documentsInit200ResponseResumedDocumentFieldStorageSizeBytes) + d.require(documentsInit200ResponseDedupedDocumentFieldStorageSizeBytes) } // SetMetadata sets the Metadata field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetMetadata(metadata map[string]any) { +func (d *DocumentsInit200ResponseDedupedDocument) SetMetadata(metadata map[string]any) { d.Metadata = metadata - d.require(documentsInit200ResponseResumedDocumentFieldMetadata) + d.require(documentsInit200ResponseDedupedDocumentFieldMetadata) } // SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetIdempotencyKey(idempotencyKey *string) { +func (d *DocumentsInit200ResponseDedupedDocument) SetIdempotencyKey(idempotencyKey *string) { d.IdempotencyKey = idempotencyKey - d.require(documentsInit200ResponseResumedDocumentFieldIdempotencyKey) + d.require(documentsInit200ResponseDedupedDocumentFieldIdempotencyKey) } // SetFailureReason sets the FailureReason field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetFailureReason(failureReason *string) { +func (d *DocumentsInit200ResponseDedupedDocument) SetFailureReason(failureReason *string) { d.FailureReason = failureReason - d.require(documentsInit200ResponseResumedDocumentFieldFailureReason) + d.require(documentsInit200ResponseDedupedDocumentFieldFailureReason) } // SetThumbnailState sets the ThumbnailState field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetThumbnailState(thumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState) { +func (d *DocumentsInit200ResponseDedupedDocument) SetThumbnailState(thumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState) { d.ThumbnailState = thumbnailState - d.require(documentsInit200ResponseResumedDocumentFieldThumbnailState) + d.require(documentsInit200ResponseDedupedDocumentFieldThumbnailState) } // SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetThumbnailURL(thumbnailURL *string) { +func (d *DocumentsInit200ResponseDedupedDocument) SetThumbnailURL(thumbnailURL *string) { d.ThumbnailURL = thumbnailURL - d.require(documentsInit200ResponseResumedDocumentFieldThumbnailURL) + d.require(documentsInit200ResponseDedupedDocumentFieldThumbnailURL) } // SetCreatedAt sets the CreatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetCreatedAt(createdAt float64) { +func (d *DocumentsInit200ResponseDedupedDocument) SetCreatedAt(createdAt float64) { d.CreatedAt = createdAt - d.require(documentsInit200ResponseResumedDocumentFieldCreatedAt) + d.require(documentsInit200ResponseDedupedDocumentFieldCreatedAt) } // SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetUpdatedAt(updatedAt float64) { +func (d *DocumentsInit200ResponseDedupedDocument) SetUpdatedAt(updatedAt float64) { d.UpdatedAt = updatedAt - d.require(documentsInit200ResponseResumedDocumentFieldUpdatedAt) + d.require(documentsInit200ResponseDedupedDocumentFieldUpdatedAt) } // SetCreatedBy sets the CreatedBy field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedDocument) SetCreatedBy(createdBy *string) { +func (d *DocumentsInit200ResponseDedupedDocument) SetCreatedBy(createdBy *string) { d.CreatedBy = createdBy - d.require(documentsInit200ResponseResumedDocumentFieldCreatedBy) + d.require(documentsInit200ResponseDedupedDocumentFieldCreatedBy) } -func (d *DocumentsInit200ResponseResumedDocument) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseResumedDocument +func (d *DocumentsInit200ResponseDedupedDocument) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseDedupedDocument var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseResumedDocument(value) + *d = DocumentsInit200ResponseDedupedDocument(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -3037,8 +3171,8 @@ func (d *DocumentsInit200ResponseResumedDocument) UnmarshalJSON(data []byte) err return nil } -func (d *DocumentsInit200ResponseResumedDocument) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseResumedDocument +func (d *DocumentsInit200ResponseDedupedDocument) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseDedupedDocument var marshaler = struct { embed }{ @@ -3048,7 +3182,7 @@ func (d *DocumentsInit200ResponseResumedDocument) MarshalJSON() ([]byte, error) return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseResumedDocument) String() string { +func (d *DocumentsInit200ResponseDedupedDocument) String() string { if d == nil { return "" } @@ -3063,196 +3197,979 @@ func (d *DocumentsInit200ResponseResumedDocument) String() string { return fmt.Sprintf("%#v", d) } -type DocumentsInit200ResponseResumedDocumentState string +type DocumentsInit200ResponseDedupedDocumentState string const ( - DocumentsInit200ResponseResumedDocumentStatePending DocumentsInit200ResponseResumedDocumentState = "pending" - DocumentsInit200ResponseResumedDocumentStateReady DocumentsInit200ResponseResumedDocumentState = "ready" - DocumentsInit200ResponseResumedDocumentStateFailed DocumentsInit200ResponseResumedDocumentState = "failed" - DocumentsInit200ResponseResumedDocumentStateDeleting DocumentsInit200ResponseResumedDocumentState = "deleting" + DocumentsInit200ResponseDedupedDocumentStatePending DocumentsInit200ResponseDedupedDocumentState = "pending" + DocumentsInit200ResponseDedupedDocumentStateReady DocumentsInit200ResponseDedupedDocumentState = "ready" + DocumentsInit200ResponseDedupedDocumentStateFailed DocumentsInit200ResponseDedupedDocumentState = "failed" + DocumentsInit200ResponseDedupedDocumentStateDeleting DocumentsInit200ResponseDedupedDocumentState = "deleting" ) -func NewDocumentsInit200ResponseResumedDocumentStateFromString(s string) (DocumentsInit200ResponseResumedDocumentState, error) { +func NewDocumentsInit200ResponseDedupedDocumentStateFromString(s string) (DocumentsInit200ResponseDedupedDocumentState, error) { switch s { case "pending": - return DocumentsInit200ResponseResumedDocumentStatePending, nil + return DocumentsInit200ResponseDedupedDocumentStatePending, nil case "ready": - return DocumentsInit200ResponseResumedDocumentStateReady, nil + return DocumentsInit200ResponseDedupedDocumentStateReady, nil case "failed": - return DocumentsInit200ResponseResumedDocumentStateFailed, nil + return DocumentsInit200ResponseDedupedDocumentStateFailed, nil case "deleting": - return DocumentsInit200ResponseResumedDocumentStateDeleting, nil + return DocumentsInit200ResponseDedupedDocumentStateDeleting, nil } - var t DocumentsInit200ResponseResumedDocumentState + var t DocumentsInit200ResponseDedupedDocumentState return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (d DocumentsInit200ResponseResumedDocumentState) Ptr() *DocumentsInit200ResponseResumedDocumentState { +func (d DocumentsInit200ResponseDedupedDocumentState) Ptr() *DocumentsInit200ResponseDedupedDocumentState { return &d } -type DocumentsInit200ResponseResumedDocumentThumbnailState string +type DocumentsInit200ResponseDedupedDocumentThumbnailState string const ( - DocumentsInit200ResponseResumedDocumentThumbnailStatePending DocumentsInit200ResponseResumedDocumentThumbnailState = "pending" - DocumentsInit200ResponseResumedDocumentThumbnailStateReady DocumentsInit200ResponseResumedDocumentThumbnailState = "ready" - DocumentsInit200ResponseResumedDocumentThumbnailStateLocked DocumentsInit200ResponseResumedDocumentThumbnailState = "locked" - DocumentsInit200ResponseResumedDocumentThumbnailStateFailed DocumentsInit200ResponseResumedDocumentThumbnailState = "failed" + DocumentsInit200ResponseDedupedDocumentThumbnailStatePending DocumentsInit200ResponseDedupedDocumentThumbnailState = "pending" + DocumentsInit200ResponseDedupedDocumentThumbnailStateReady DocumentsInit200ResponseDedupedDocumentThumbnailState = "ready" + DocumentsInit200ResponseDedupedDocumentThumbnailStateLocked DocumentsInit200ResponseDedupedDocumentThumbnailState = "locked" + DocumentsInit200ResponseDedupedDocumentThumbnailStateFailed DocumentsInit200ResponseDedupedDocumentThumbnailState = "failed" ) -func NewDocumentsInit200ResponseResumedDocumentThumbnailStateFromString(s string) (DocumentsInit200ResponseResumedDocumentThumbnailState, error) { +func NewDocumentsInit200ResponseDedupedDocumentThumbnailStateFromString(s string) (DocumentsInit200ResponseDedupedDocumentThumbnailState, error) { switch s { case "pending": - return DocumentsInit200ResponseResumedDocumentThumbnailStatePending, nil + return DocumentsInit200ResponseDedupedDocumentThumbnailStatePending, nil case "ready": - return DocumentsInit200ResponseResumedDocumentThumbnailStateReady, nil + return DocumentsInit200ResponseDedupedDocumentThumbnailStateReady, nil case "locked": - return DocumentsInit200ResponseResumedDocumentThumbnailStateLocked, nil + return DocumentsInit200ResponseDedupedDocumentThumbnailStateLocked, nil case "failed": - return DocumentsInit200ResponseResumedDocumentThumbnailStateFailed, nil + return DocumentsInit200ResponseDedupedDocumentThumbnailStateFailed, nil } - var t DocumentsInit200ResponseResumedDocumentThumbnailState + var t DocumentsInit200ResponseDedupedDocumentThumbnailState return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (d DocumentsInit200ResponseResumedDocumentThumbnailState) Ptr() *DocumentsInit200ResponseResumedDocumentThumbnailState { +func (d DocumentsInit200ResponseDedupedDocumentThumbnailState) Ptr() *DocumentsInit200ResponseDedupedDocumentThumbnailState { return &d } -type DocumentsInit200ResponseResumedUpload struct { - Kind string - Presigned *DocumentsInit200ResponseResumedUploadPresigned - Proxy *DocumentsInit200ResponseResumedUploadProxy +var ( + documentsInit200ResponseResumedFieldDocument = big.NewInt(1 << 0) + documentsInit200ResponseResumedFieldUpload = big.NewInt(1 << 1) +) - rawJSON json.RawMessage +type DocumentsInit200ResponseResumed struct { + Document *DocumentsInit200ResponseResumedDocument `json:"document" url:"document"` + Upload *DocumentsInit200ResponseResumedUpload `json:"upload" url:"upload"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseResumedUpload) GetKind() string { +func (d *DocumentsInit200ResponseResumed) GetDocument() *DocumentsInit200ResponseResumedDocument { if d == nil { - return "" + return nil } - return d.Kind + return d.Document } -func (d *DocumentsInit200ResponseResumedUpload) GetPresigned() *DocumentsInit200ResponseResumedUploadPresigned { +func (d *DocumentsInit200ResponseResumed) GetUpload() *DocumentsInit200ResponseResumedUpload { if d == nil { return nil } - return d.Presigned + return d.Upload } -func (d *DocumentsInit200ResponseResumedUpload) GetProxy() *DocumentsInit200ResponseResumedUploadProxy { +func (d *DocumentsInit200ResponseResumed) GetExtraProperties() map[string]interface{} { if d == nil { return nil } - return d.Proxy + return d.extraProperties } -func (d *DocumentsInit200ResponseResumedUpload) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Kind string `json:"kind"` +func (d *DocumentsInit200ResponseResumed) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) } - if err := json.Unmarshal(data, &unmarshaler); err != nil { + d.explicitFields.Or(d.explicitFields, field) +} + +// SetDocument sets the Document field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumed) SetDocument(document *DocumentsInit200ResponseResumedDocument) { + d.Document = document + d.require(documentsInit200ResponseResumedFieldDocument) +} + +// SetUpload sets the Upload field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumed) SetUpload(upload *DocumentsInit200ResponseResumedUpload) { + d.Upload = upload + d.require(documentsInit200ResponseResumedFieldUpload) +} + +func (d *DocumentsInit200ResponseResumed) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseResumed + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - d.Kind = unmarshaler.Kind - if unmarshaler.Kind == "" { - return fmt.Errorf("%T did not include discriminant kind", d) - } - switch unmarshaler.Kind { - case "presigned": - value := new(DocumentsInit200ResponseResumedUploadPresigned) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - d.Presigned = value - case "proxy": - value := new(DocumentsInit200ResponseResumedUploadProxy) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - d.Proxy = value + *d = DocumentsInit200ResponseResumed(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err } + d.extraProperties = extraProperties d.rawJSON = json.RawMessage(data) return nil } -func (d DocumentsInit200ResponseResumedUpload) MarshalJSON() ([]byte, error) { - if err := d.validate(); err != nil { - return nil, err - } - if d.Presigned != nil { - return internal.MarshalJSONWithExtraProperty(d.Presigned, "kind", "presigned") +func (d *DocumentsInit200ResponseResumed) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseResumed + var marshaler = struct { + embed + }{ + embed: embed(*d), } - if d.Proxy != nil { - return internal.MarshalJSONWithExtraProperty(d.Proxy, "kind", "proxy") + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsInit200ResponseResumed) String() string { + if d == nil { + return "" } if len(d.rawJSON) > 0 { - return d.rawJSON, nil + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } } - return nil, fmt.Errorf("type %T does not define a non-empty union type", d) + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) } -type DocumentsInit200ResponseResumedUploadVisitor interface { - VisitPresigned(*DocumentsInit200ResponseResumedUploadPresigned) error - VisitProxy(*DocumentsInit200ResponseResumedUploadProxy) error +var ( + documentsInit200ResponseResumedDocumentFieldID = big.NewInt(1 << 0) + documentsInit200ResponseResumedDocumentFieldTenantID = big.NewInt(1 << 1) + documentsInit200ResponseResumedDocumentFieldState = big.NewInt(1 << 2) + documentsInit200ResponseResumedDocumentFieldBaseSha = big.NewInt(1 << 3) + documentsInit200ResponseResumedDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) + documentsInit200ResponseResumedDocumentFieldMetadata = big.NewInt(1 << 5) + documentsInit200ResponseResumedDocumentFieldIdempotencyKey = big.NewInt(1 << 6) + documentsInit200ResponseResumedDocumentFieldFailureReason = big.NewInt(1 << 7) + documentsInit200ResponseResumedDocumentFieldThumbnailState = big.NewInt(1 << 8) + documentsInit200ResponseResumedDocumentFieldThumbnailURL = big.NewInt(1 << 9) + documentsInit200ResponseResumedDocumentFieldCreatedAt = big.NewInt(1 << 10) + documentsInit200ResponseResumedDocumentFieldUpdatedAt = big.NewInt(1 << 11) + documentsInit200ResponseResumedDocumentFieldCreatedBy = big.NewInt(1 << 12) +) + +type DocumentsInit200ResponseResumedDocument struct { + ID string `json:"id" url:"id"` + TenantID string `json:"tenantId" url:"tenantId"` + State DocumentsInit200ResponseResumedDocumentState `json:"state" url:"state"` + BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` + StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` + Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` + FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` + ThumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` + ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` + CreatedAt float64 `json:"createdAt" url:"createdAt"` + UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseResumedUpload) Accept(visitor DocumentsInit200ResponseResumedUploadVisitor) error { - if d.Presigned != nil { - return visitor.VisitPresigned(d.Presigned) - } - if d.Proxy != nil { - return visitor.VisitProxy(d.Proxy) +func (d *DocumentsInit200ResponseResumedDocument) GetID() string { + if d == nil { + return "" } - return fmt.Errorf("type %T does not define a non-empty union type", d) + return d.ID } -func (d *DocumentsInit200ResponseResumedUpload) validate() error { +func (d *DocumentsInit200ResponseResumedDocument) GetTenantID() string { if d == nil { - return fmt.Errorf("type %T is nil", d) + return "" } - var fields []string - if d.Presigned != nil { - fields = append(fields, "presigned") + return d.TenantID +} + +func (d *DocumentsInit200ResponseResumedDocument) GetState() DocumentsInit200ResponseResumedDocumentState { + if d == nil { + return "" } - if d.Proxy != nil { - fields = append(fields, "proxy") + return d.State +} + +func (d *DocumentsInit200ResponseResumedDocument) GetBaseSha() *string { + if d == nil { + return nil } - if len(fields) == 0 { - if d.Kind != "" { - if len(d.rawJSON) > 0 { - return nil - } - return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", d, d.Kind) - } - return fmt.Errorf("type %T is empty", d) + return d.BaseSha +} + +func (d *DocumentsInit200ResponseResumedDocument) GetStorageSizeBytes() *float64 { + if d == nil { + return nil } - if len(fields) > 1 { + return d.StorageSizeBytes +} + +func (d *DocumentsInit200ResponseResumedDocument) GetMetadata() map[string]any { + if d == nil { + return nil + } + return d.Metadata +} + +func (d *DocumentsInit200ResponseResumedDocument) GetIdempotencyKey() *string { + if d == nil { + return nil + } + return d.IdempotencyKey +} + +func (d *DocumentsInit200ResponseResumedDocument) GetFailureReason() *string { + if d == nil { + return nil + } + return d.FailureReason +} + +func (d *DocumentsInit200ResponseResumedDocument) GetThumbnailState() *DocumentsInit200ResponseResumedDocumentThumbnailState { + if d == nil { + return nil + } + return d.ThumbnailState +} + +func (d *DocumentsInit200ResponseResumedDocument) GetThumbnailURL() *string { + if d == nil { + return nil + } + return d.ThumbnailURL +} + +func (d *DocumentsInit200ResponseResumedDocument) GetCreatedAt() float64 { + if d == nil { + return 0 + } + return d.CreatedAt +} + +func (d *DocumentsInit200ResponseResumedDocument) GetUpdatedAt() float64 { + if d == nil { + return 0 + } + return d.UpdatedAt +} + +func (d *DocumentsInit200ResponseResumedDocument) GetCreatedBy() *string { + if d == nil { + return nil + } + return d.CreatedBy +} + +func (d *DocumentsInit200ResponseResumedDocument) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsInit200ResponseResumedDocument) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetID(id string) { + d.ID = id + d.require(documentsInit200ResponseResumedDocumentFieldID) +} + +// SetTenantID sets the TenantID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetTenantID(tenantID string) { + d.TenantID = tenantID + d.require(documentsInit200ResponseResumedDocumentFieldTenantID) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetState(state DocumentsInit200ResponseResumedDocumentState) { + d.State = state + d.require(documentsInit200ResponseResumedDocumentFieldState) +} + +// SetBaseSha sets the BaseSha field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetBaseSha(baseSha *string) { + d.BaseSha = baseSha + d.require(documentsInit200ResponseResumedDocumentFieldBaseSha) +} + +// SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetStorageSizeBytes(storageSizeBytes *float64) { + d.StorageSizeBytes = storageSizeBytes + d.require(documentsInit200ResponseResumedDocumentFieldStorageSizeBytes) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetMetadata(metadata map[string]any) { + d.Metadata = metadata + d.require(documentsInit200ResponseResumedDocumentFieldMetadata) +} + +// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetIdempotencyKey(idempotencyKey *string) { + d.IdempotencyKey = idempotencyKey + d.require(documentsInit200ResponseResumedDocumentFieldIdempotencyKey) +} + +// SetFailureReason sets the FailureReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetFailureReason(failureReason *string) { + d.FailureReason = failureReason + d.require(documentsInit200ResponseResumedDocumentFieldFailureReason) +} + +// SetThumbnailState sets the ThumbnailState field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetThumbnailState(thumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState) { + d.ThumbnailState = thumbnailState + d.require(documentsInit200ResponseResumedDocumentFieldThumbnailState) +} + +// SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetThumbnailURL(thumbnailURL *string) { + d.ThumbnailURL = thumbnailURL + d.require(documentsInit200ResponseResumedDocumentFieldThumbnailURL) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetCreatedAt(createdAt float64) { + d.CreatedAt = createdAt + d.require(documentsInit200ResponseResumedDocumentFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetUpdatedAt(updatedAt float64) { + d.UpdatedAt = updatedAt + d.require(documentsInit200ResponseResumedDocumentFieldUpdatedAt) +} + +// SetCreatedBy sets the CreatedBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedDocument) SetCreatedBy(createdBy *string) { + d.CreatedBy = createdBy + d.require(documentsInit200ResponseResumedDocumentFieldCreatedBy) +} + +func (d *DocumentsInit200ResponseResumedDocument) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseResumedDocument + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsInit200ResponseResumedDocument(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsInit200ResponseResumedDocument) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseResumedDocument + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsInit200ResponseResumedDocument) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +type DocumentsInit200ResponseResumedDocumentState string + +const ( + DocumentsInit200ResponseResumedDocumentStatePending DocumentsInit200ResponseResumedDocumentState = "pending" + DocumentsInit200ResponseResumedDocumentStateReady DocumentsInit200ResponseResumedDocumentState = "ready" + DocumentsInit200ResponseResumedDocumentStateFailed DocumentsInit200ResponseResumedDocumentState = "failed" + DocumentsInit200ResponseResumedDocumentStateDeleting DocumentsInit200ResponseResumedDocumentState = "deleting" +) + +func NewDocumentsInit200ResponseResumedDocumentStateFromString(s string) (DocumentsInit200ResponseResumedDocumentState, error) { + switch s { + case "pending": + return DocumentsInit200ResponseResumedDocumentStatePending, nil + case "ready": + return DocumentsInit200ResponseResumedDocumentStateReady, nil + case "failed": + return DocumentsInit200ResponseResumedDocumentStateFailed, nil + case "deleting": + return DocumentsInit200ResponseResumedDocumentStateDeleting, nil + } + var t DocumentsInit200ResponseResumedDocumentState + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsInit200ResponseResumedDocumentState) Ptr() *DocumentsInit200ResponseResumedDocumentState { + return &d +} + +type DocumentsInit200ResponseResumedDocumentThumbnailState string + +const ( + DocumentsInit200ResponseResumedDocumentThumbnailStatePending DocumentsInit200ResponseResumedDocumentThumbnailState = "pending" + DocumentsInit200ResponseResumedDocumentThumbnailStateReady DocumentsInit200ResponseResumedDocumentThumbnailState = "ready" + DocumentsInit200ResponseResumedDocumentThumbnailStateLocked DocumentsInit200ResponseResumedDocumentThumbnailState = "locked" + DocumentsInit200ResponseResumedDocumentThumbnailStateFailed DocumentsInit200ResponseResumedDocumentThumbnailState = "failed" +) + +func NewDocumentsInit200ResponseResumedDocumentThumbnailStateFromString(s string) (DocumentsInit200ResponseResumedDocumentThumbnailState, error) { + switch s { + case "pending": + return DocumentsInit200ResponseResumedDocumentThumbnailStatePending, nil + case "ready": + return DocumentsInit200ResponseResumedDocumentThumbnailStateReady, nil + case "locked": + return DocumentsInit200ResponseResumedDocumentThumbnailStateLocked, nil + case "failed": + return DocumentsInit200ResponseResumedDocumentThumbnailStateFailed, nil + } + var t DocumentsInit200ResponseResumedDocumentThumbnailState + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsInit200ResponseResumedDocumentThumbnailState) Ptr() *DocumentsInit200ResponseResumedDocumentThumbnailState { + return &d +} + +type DocumentsInit200ResponseResumedUpload struct { + Kind string + Presigned *DocumentsInit200ResponseResumedUploadPresigned + Proxy *DocumentsInit200ResponseResumedUploadProxy + + rawJSON json.RawMessage +} + +func (d *DocumentsInit200ResponseResumedUpload) GetKind() string { + if d == nil { + return "" + } + return d.Kind +} + +func (d *DocumentsInit200ResponseResumedUpload) GetPresigned() *DocumentsInit200ResponseResumedUploadPresigned { + if d == nil { + return nil + } + return d.Presigned +} + +func (d *DocumentsInit200ResponseResumedUpload) GetProxy() *DocumentsInit200ResponseResumedUploadProxy { + if d == nil { + return nil + } + return d.Proxy +} + +func (d *DocumentsInit200ResponseResumedUpload) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + Kind string `json:"kind"` + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + d.Kind = unmarshaler.Kind + if unmarshaler.Kind == "" { + return fmt.Errorf("%T did not include discriminant kind", d) + } + switch unmarshaler.Kind { + case "presigned": + value := new(DocumentsInit200ResponseResumedUploadPresigned) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + d.Presigned = value + case "proxy": + value := new(DocumentsInit200ResponseResumedUploadProxy) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + d.Proxy = value + } + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d DocumentsInit200ResponseResumedUpload) MarshalJSON() ([]byte, error) { + if err := d.validate(); err != nil { + return nil, err + } + if d.Presigned != nil { + return internal.MarshalJSONWithExtraProperty(d.Presigned, "kind", "presigned") + } + if d.Proxy != nil { + return internal.MarshalJSONWithExtraProperty(d.Proxy, "kind", "proxy") + } + if len(d.rawJSON) > 0 { + return d.rawJSON, nil + } + return nil, fmt.Errorf("type %T does not define a non-empty union type", d) +} + +type DocumentsInit200ResponseResumedUploadVisitor interface { + VisitPresigned(*DocumentsInit200ResponseResumedUploadPresigned) error + VisitProxy(*DocumentsInit200ResponseResumedUploadProxy) error +} + +func (d *DocumentsInit200ResponseResumedUpload) Accept(visitor DocumentsInit200ResponseResumedUploadVisitor) error { + if d.Presigned != nil { + return visitor.VisitPresigned(d.Presigned) + } + if d.Proxy != nil { + return visitor.VisitProxy(d.Proxy) + } + return fmt.Errorf("type %T does not define a non-empty union type", d) +} + +func (d *DocumentsInit200ResponseResumedUpload) validate() error { + if d == nil { + return fmt.Errorf("type %T is nil", d) + } + var fields []string + if d.Presigned != nil { + fields = append(fields, "presigned") + } + if d.Proxy != nil { + fields = append(fields, "proxy") + } + if len(fields) == 0 { + if d.Kind != "" { + if len(d.rawJSON) > 0 { + return nil + } + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", d, d.Kind) + } + return fmt.Errorf("type %T is empty", d) + } + if len(fields) > 1 { return fmt.Errorf("type %T defines values for %s, but only one value is allowed", d, fields) } - if d.Kind != "" { - field := fields[0] - if d.Kind != field { - return fmt.Errorf( - "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", - d, - d.Kind, - d, - ) + if d.Kind != "" { + field := fields[0] + if d.Kind != field { + return fmt.Errorf( + "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", + d, + d.Kind, + d, + ) + } + } + return nil +} + +var ( + documentsInit200ResponseResumedUploadPresignedFieldPresigned = big.NewInt(1 << 0) + documentsInit200ResponseResumedUploadPresignedFieldKey = big.NewInt(1 << 1) +) + +type DocumentsInit200ResponseResumedUploadPresigned struct { + Presigned *DocumentsInit200ResponseResumedUploadPresignedPresigned `json:"presigned" url:"presigned"` + Key string `json:"key" url:"key"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsInit200ResponseResumedUploadPresigned) GetPresigned() *DocumentsInit200ResponseResumedUploadPresignedPresigned { + if d == nil { + return nil + } + return d.Presigned +} + +func (d *DocumentsInit200ResponseResumedUploadPresigned) GetKey() string { + if d == nil { + return "" + } + return d.Key +} + +func (d *DocumentsInit200ResponseResumedUploadPresigned) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsInit200ResponseResumedUploadPresigned) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetPresigned sets the Presigned field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadPresigned) SetPresigned(presigned *DocumentsInit200ResponseResumedUploadPresignedPresigned) { + d.Presigned = presigned + d.require(documentsInit200ResponseResumedUploadPresignedFieldPresigned) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadPresigned) SetKey(key string) { + d.Key = key + d.require(documentsInit200ResponseResumedUploadPresignedFieldKey) +} + +func (d *DocumentsInit200ResponseResumedUploadPresigned) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseResumedUploadPresigned + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsInit200ResponseResumedUploadPresigned(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsInit200ResponseResumedUploadPresigned) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseResumedUploadPresigned + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsInit200ResponseResumedUploadPresigned) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +var ( + documentsInit200ResponseResumedUploadPresignedPresignedFieldURL = big.NewInt(1 << 0) + documentsInit200ResponseResumedUploadPresignedPresignedFieldHeaders = big.NewInt(1 << 1) + documentsInit200ResponseResumedUploadPresignedPresignedFieldMethod = big.NewInt(1 << 2) + documentsInit200ResponseResumedUploadPresignedPresignedFieldExpiresAt = big.NewInt(1 << 3) +) + +type DocumentsInit200ResponseResumedUploadPresignedPresigned struct { + URL string `json:"url" url:"url"` + Headers map[string]string `json:"headers" url:"headers"` + Method DocumentsInit200ResponseResumedUploadPresignedPresignedMethod `json:"method" url:"method"` + ExpiresAt float64 `json:"expiresAt" url:"expiresAt"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetURL() string { + if d == nil { + return "" + } + return d.URL +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetHeaders() map[string]string { + if d == nil { + return nil + } + return d.Headers +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetMethod() DocumentsInit200ResponseResumedUploadPresignedPresignedMethod { + if d == nil { + return "" + } + return d.Method +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetExpiresAt() float64 { + if d == nil { + return 0 + } + return d.ExpiresAt +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetURL sets the URL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetURL(url string) { + d.URL = url + d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldURL) +} + +// SetHeaders sets the Headers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetHeaders(headers map[string]string) { + d.Headers = headers + d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldHeaders) +} + +// SetMethod sets the Method field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetMethod(method DocumentsInit200ResponseResumedUploadPresignedPresignedMethod) { + d.Method = method + d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldMethod) +} + +// SetExpiresAt sets the ExpiresAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetExpiresAt(expiresAt float64) { + d.ExpiresAt = expiresAt + d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldExpiresAt) +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseResumedUploadPresignedPresigned + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsInit200ResponseResumedUploadPresignedPresigned(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseResumedUploadPresignedPresigned + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +type DocumentsInit200ResponseResumedUploadPresignedPresignedMethod string + +const ( + DocumentsInit200ResponseResumedUploadPresignedPresignedMethodPut DocumentsInit200ResponseResumedUploadPresignedPresignedMethod = "PUT" +) + +func NewDocumentsInit200ResponseResumedUploadPresignedPresignedMethodFromString(s string) (DocumentsInit200ResponseResumedUploadPresignedPresignedMethod, error) { + switch s { + case "PUT": + return DocumentsInit200ResponseResumedUploadPresignedPresignedMethodPut, nil + } + var t DocumentsInit200ResponseResumedUploadPresignedPresignedMethod + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsInit200ResponseResumedUploadPresignedPresignedMethod) Ptr() *DocumentsInit200ResponseResumedUploadPresignedPresignedMethod { + return &d +} + +var ( + documentsInit200ResponseResumedUploadProxyFieldURL = big.NewInt(1 << 0) + documentsInit200ResponseResumedUploadProxyFieldKey = big.NewInt(1 << 1) +) + +type DocumentsInit200ResponseResumedUploadProxy struct { + URL string `json:"url" url:"url"` + Key string `json:"key" url:"key"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsInit200ResponseResumedUploadProxy) GetURL() string { + if d == nil { + return "" + } + return d.URL +} + +func (d *DocumentsInit200ResponseResumedUploadProxy) GetKey() string { + if d == nil { + return "" + } + return d.Key +} + +func (d *DocumentsInit200ResponseResumedUploadProxy) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsInit200ResponseResumedUploadProxy) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetURL sets the URL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadProxy) SetURL(url string) { + d.URL = url + d.require(documentsInit200ResponseResumedUploadProxyFieldURL) +} + +// SetKey sets the Key field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsInit200ResponseResumedUploadProxy) SetKey(key string) { + d.Key = key + d.require(documentsInit200ResponseResumedUploadProxyFieldKey) +} + +func (d *DocumentsInit200ResponseResumedUploadProxy) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsInit200ResponseResumedUploadProxy + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsInit200ResponseResumedUploadProxy(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsInit200ResponseResumedUploadProxy) MarshalJSON() ([]byte, error) { + type embed DocumentsInit200ResponseResumedUploadProxy + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsInit200ResponseResumedUploadProxy) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value } } - return nil + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) } var ( - documentsInit200ResponseResumedUploadPresignedFieldPresigned = big.NewInt(1 << 0) - documentsInit200ResponseResumedUploadPresignedFieldKey = big.NewInt(1 << 1) + documentsList200ResponseFieldDocuments = big.NewInt(1 << 0) + documentsList200ResponseFieldNextCursor = big.NewInt(1 << 1) ) -type DocumentsInit200ResponseResumedUploadPresigned struct { - Presigned *DocumentsInit200ResponseResumedUploadPresignedPresigned `json:"presigned" url:"presigned"` - Key string `json:"key" url:"key"` +type DocumentsList200Response struct { + Documents []*DocumentsList200ResponseDocumentsItem `json:"documents" url:"documents"` + NextCursor *string `json:"nextCursor,omitempty" url:"nextCursor,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -3261,55 +4178,55 @@ type DocumentsInit200ResponseResumedUploadPresigned struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseResumedUploadPresigned) GetPresigned() *DocumentsInit200ResponseResumedUploadPresignedPresigned { +func (d *DocumentsList200Response) GetDocuments() []*DocumentsList200ResponseDocumentsItem { if d == nil { return nil } - return d.Presigned + return d.Documents } -func (d *DocumentsInit200ResponseResumedUploadPresigned) GetKey() string { +func (d *DocumentsList200Response) GetNextCursor() *string { if d == nil { - return "" + return nil } - return d.Key + return d.NextCursor } -func (d *DocumentsInit200ResponseResumedUploadPresigned) GetExtraProperties() map[string]interface{} { +func (d *DocumentsList200Response) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseResumedUploadPresigned) require(field *big.Int) { +func (d *DocumentsList200Response) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetPresigned sets the Presigned field and marks it as non-optional; +// SetDocuments sets the Documents field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadPresigned) SetPresigned(presigned *DocumentsInit200ResponseResumedUploadPresignedPresigned) { - d.Presigned = presigned - d.require(documentsInit200ResponseResumedUploadPresignedFieldPresigned) +func (d *DocumentsList200Response) SetDocuments(documents []*DocumentsList200ResponseDocumentsItem) { + d.Documents = documents + d.require(documentsList200ResponseFieldDocuments) } -// SetKey sets the Key field and marks it as non-optional; +// SetNextCursor sets the NextCursor field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadPresigned) SetKey(key string) { - d.Key = key - d.require(documentsInit200ResponseResumedUploadPresignedFieldKey) +func (d *DocumentsList200Response) SetNextCursor(nextCursor *string) { + d.NextCursor = nextCursor + d.require(documentsList200ResponseFieldNextCursor) } -func (d *DocumentsInit200ResponseResumedUploadPresigned) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseResumedUploadPresigned +func (d *DocumentsList200Response) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsList200Response var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseResumedUploadPresigned(value) + *d = DocumentsList200Response(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -3319,8 +4236,8 @@ func (d *DocumentsInit200ResponseResumedUploadPresigned) UnmarshalJSON(data []by return nil } -func (d *DocumentsInit200ResponseResumedUploadPresigned) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseResumedUploadPresigned +func (d *DocumentsList200Response) MarshalJSON() ([]byte, error) { + type embed DocumentsList200Response var marshaler = struct { embed }{ @@ -3330,7 +4247,7 @@ func (d *DocumentsInit200ResponseResumedUploadPresigned) MarshalJSON() ([]byte, return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseResumedUploadPresigned) String() string { +func (d *DocumentsList200Response) String() string { if d == nil { return "" } @@ -3346,17 +4263,35 @@ func (d *DocumentsInit200ResponseResumedUploadPresigned) String() string { } var ( - documentsInit200ResponseResumedUploadPresignedPresignedFieldURL = big.NewInt(1 << 0) - documentsInit200ResponseResumedUploadPresignedPresignedFieldHeaders = big.NewInt(1 << 1) - documentsInit200ResponseResumedUploadPresignedPresignedFieldMethod = big.NewInt(1 << 2) - documentsInit200ResponseResumedUploadPresignedPresignedFieldExpiresAt = big.NewInt(1 << 3) + documentsList200ResponseDocumentsItemFieldID = big.NewInt(1 << 0) + documentsList200ResponseDocumentsItemFieldTenantID = big.NewInt(1 << 1) + documentsList200ResponseDocumentsItemFieldState = big.NewInt(1 << 2) + documentsList200ResponseDocumentsItemFieldBaseSha = big.NewInt(1 << 3) + documentsList200ResponseDocumentsItemFieldStorageSizeBytes = big.NewInt(1 << 4) + documentsList200ResponseDocumentsItemFieldMetadata = big.NewInt(1 << 5) + documentsList200ResponseDocumentsItemFieldIdempotencyKey = big.NewInt(1 << 6) + documentsList200ResponseDocumentsItemFieldFailureReason = big.NewInt(1 << 7) + documentsList200ResponseDocumentsItemFieldThumbnailState = big.NewInt(1 << 8) + documentsList200ResponseDocumentsItemFieldThumbnailURL = big.NewInt(1 << 9) + documentsList200ResponseDocumentsItemFieldCreatedAt = big.NewInt(1 << 10) + documentsList200ResponseDocumentsItemFieldUpdatedAt = big.NewInt(1 << 11) + documentsList200ResponseDocumentsItemFieldCreatedBy = big.NewInt(1 << 12) ) -type DocumentsInit200ResponseResumedUploadPresignedPresigned struct { - URL string `json:"url" url:"url"` - Headers map[string]string `json:"headers" url:"headers"` - Method DocumentsInit200ResponseResumedUploadPresignedPresignedMethod `json:"method" url:"method"` - ExpiresAt float64 `json:"expiresAt" url:"expiresAt"` +type DocumentsList200ResponseDocumentsItem struct { + ID string `json:"id" url:"id"` + TenantID string `json:"tenantId" url:"tenantId"` + State DocumentsList200ResponseDocumentsItemState `json:"state" url:"state"` + BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` + StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` + Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` + FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` + ThumbnailState *DocumentsList200ResponseDocumentsItemThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` + ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` + CreatedAt float64 `json:"createdAt" url:"createdAt"` + UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -3365,83 +4300,209 @@ type DocumentsInit200ResponseResumedUploadPresignedPresigned struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetURL() string { +func (d *DocumentsList200ResponseDocumentsItem) GetID() string { if d == nil { return "" } - return d.URL + return d.ID } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetHeaders() map[string]string { +func (d *DocumentsList200ResponseDocumentsItem) GetTenantID() string { if d == nil { - return nil + return "" } - return d.Headers + return d.TenantID } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetMethod() DocumentsInit200ResponseResumedUploadPresignedPresignedMethod { +func (d *DocumentsList200ResponseDocumentsItem) GetState() DocumentsList200ResponseDocumentsItemState { if d == nil { return "" } - return d.Method + return d.State } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetExpiresAt() float64 { +func (d *DocumentsList200ResponseDocumentsItem) GetBaseSha() *string { + if d == nil { + return nil + } + return d.BaseSha +} + +func (d *DocumentsList200ResponseDocumentsItem) GetStorageSizeBytes() *float64 { + if d == nil { + return nil + } + return d.StorageSizeBytes +} + +func (d *DocumentsList200ResponseDocumentsItem) GetMetadata() map[string]any { + if d == nil { + return nil + } + return d.Metadata +} + +func (d *DocumentsList200ResponseDocumentsItem) GetIdempotencyKey() *string { + if d == nil { + return nil + } + return d.IdempotencyKey +} + +func (d *DocumentsList200ResponseDocumentsItem) GetFailureReason() *string { + if d == nil { + return nil + } + return d.FailureReason +} + +func (d *DocumentsList200ResponseDocumentsItem) GetThumbnailState() *DocumentsList200ResponseDocumentsItemThumbnailState { + if d == nil { + return nil + } + return d.ThumbnailState +} + +func (d *DocumentsList200ResponseDocumentsItem) GetThumbnailURL() *string { + if d == nil { + return nil + } + return d.ThumbnailURL +} + +func (d *DocumentsList200ResponseDocumentsItem) GetCreatedAt() float64 { if d == nil { return 0 } - return d.ExpiresAt + return d.CreatedAt } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) GetExtraProperties() map[string]interface{} { +func (d *DocumentsList200ResponseDocumentsItem) GetUpdatedAt() float64 { + if d == nil { + return 0 + } + return d.UpdatedAt +} + +func (d *DocumentsList200ResponseDocumentsItem) GetCreatedBy() *string { + if d == nil { + return nil + } + return d.CreatedBy +} + +func (d *DocumentsList200ResponseDocumentsItem) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) require(field *big.Int) { +func (d *DocumentsList200ResponseDocumentsItem) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetURL sets the URL field and marks it as non-optional; +// SetID sets the ID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetURL(url string) { - d.URL = url - d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldURL) +func (d *DocumentsList200ResponseDocumentsItem) SetID(id string) { + d.ID = id + d.require(documentsList200ResponseDocumentsItemFieldID) +} + +// SetTenantID sets the TenantID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetTenantID(tenantID string) { + d.TenantID = tenantID + d.require(documentsList200ResponseDocumentsItemFieldTenantID) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetState(state DocumentsList200ResponseDocumentsItemState) { + d.State = state + d.require(documentsList200ResponseDocumentsItemFieldState) +} + +// SetBaseSha sets the BaseSha field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetBaseSha(baseSha *string) { + d.BaseSha = baseSha + d.require(documentsList200ResponseDocumentsItemFieldBaseSha) +} + +// SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetStorageSizeBytes(storageSizeBytes *float64) { + d.StorageSizeBytes = storageSizeBytes + d.require(documentsList200ResponseDocumentsItemFieldStorageSizeBytes) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetMetadata(metadata map[string]any) { + d.Metadata = metadata + d.require(documentsList200ResponseDocumentsItemFieldMetadata) +} + +// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetIdempotencyKey(idempotencyKey *string) { + d.IdempotencyKey = idempotencyKey + d.require(documentsList200ResponseDocumentsItemFieldIdempotencyKey) +} + +// SetFailureReason sets the FailureReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetFailureReason(failureReason *string) { + d.FailureReason = failureReason + d.require(documentsList200ResponseDocumentsItemFieldFailureReason) +} + +// SetThumbnailState sets the ThumbnailState field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetThumbnailState(thumbnailState *DocumentsList200ResponseDocumentsItemThumbnailState) { + d.ThumbnailState = thumbnailState + d.require(documentsList200ResponseDocumentsItemFieldThumbnailState) +} + +// SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsList200ResponseDocumentsItem) SetThumbnailURL(thumbnailURL *string) { + d.ThumbnailURL = thumbnailURL + d.require(documentsList200ResponseDocumentsItemFieldThumbnailURL) } -// SetHeaders sets the Headers field and marks it as non-optional; +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetHeaders(headers map[string]string) { - d.Headers = headers - d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldHeaders) +func (d *DocumentsList200ResponseDocumentsItem) SetCreatedAt(createdAt float64) { + d.CreatedAt = createdAt + d.require(documentsList200ResponseDocumentsItemFieldCreatedAt) } -// SetMethod sets the Method field and marks it as non-optional; +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetMethod(method DocumentsInit200ResponseResumedUploadPresignedPresignedMethod) { - d.Method = method - d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldMethod) +func (d *DocumentsList200ResponseDocumentsItem) SetUpdatedAt(updatedAt float64) { + d.UpdatedAt = updatedAt + d.require(documentsList200ResponseDocumentsItemFieldUpdatedAt) } -// SetExpiresAt sets the ExpiresAt field and marks it as non-optional; +// SetCreatedBy sets the CreatedBy field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) SetExpiresAt(expiresAt float64) { - d.ExpiresAt = expiresAt - d.require(documentsInit200ResponseResumedUploadPresignedPresignedFieldExpiresAt) +func (d *DocumentsList200ResponseDocumentsItem) SetCreatedBy(createdBy *string) { + d.CreatedBy = createdBy + d.require(documentsList200ResponseDocumentsItemFieldCreatedBy) } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseResumedUploadPresignedPresigned +func (d *DocumentsList200ResponseDocumentsItem) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsList200ResponseDocumentsItem var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseResumedUploadPresignedPresigned(value) + *d = DocumentsList200ResponseDocumentsItem(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -3451,8 +4512,8 @@ func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) UnmarshalJSON( return nil } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseResumedUploadPresignedPresigned +func (d *DocumentsList200ResponseDocumentsItem) MarshalJSON() ([]byte, error) { + type embed DocumentsList200ResponseDocumentsItem var marshaler = struct { embed }{ @@ -3462,7 +4523,7 @@ func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) MarshalJSON() return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) String() string { +func (d *DocumentsList200ResponseDocumentsItem) String() string { if d == nil { return "" } @@ -3477,33 +4538,68 @@ func (d *DocumentsInit200ResponseResumedUploadPresignedPresigned) String() strin return fmt.Sprintf("%#v", d) } -type DocumentsInit200ResponseResumedUploadPresignedPresignedMethod string +type DocumentsList200ResponseDocumentsItemState string const ( - DocumentsInit200ResponseResumedUploadPresignedPresignedMethodPut DocumentsInit200ResponseResumedUploadPresignedPresignedMethod = "PUT" + DocumentsList200ResponseDocumentsItemStatePending DocumentsList200ResponseDocumentsItemState = "pending" + DocumentsList200ResponseDocumentsItemStateReady DocumentsList200ResponseDocumentsItemState = "ready" + DocumentsList200ResponseDocumentsItemStateFailed DocumentsList200ResponseDocumentsItemState = "failed" + DocumentsList200ResponseDocumentsItemStateDeleting DocumentsList200ResponseDocumentsItemState = "deleting" ) -func NewDocumentsInit200ResponseResumedUploadPresignedPresignedMethodFromString(s string) (DocumentsInit200ResponseResumedUploadPresignedPresignedMethod, error) { +func NewDocumentsList200ResponseDocumentsItemStateFromString(s string) (DocumentsList200ResponseDocumentsItemState, error) { switch s { - case "PUT": - return DocumentsInit200ResponseResumedUploadPresignedPresignedMethodPut, nil + case "pending": + return DocumentsList200ResponseDocumentsItemStatePending, nil + case "ready": + return DocumentsList200ResponseDocumentsItemStateReady, nil + case "failed": + return DocumentsList200ResponseDocumentsItemStateFailed, nil + case "deleting": + return DocumentsList200ResponseDocumentsItemStateDeleting, nil } - var t DocumentsInit200ResponseResumedUploadPresignedPresignedMethod + var t DocumentsList200ResponseDocumentsItemState return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (d DocumentsInit200ResponseResumedUploadPresignedPresignedMethod) Ptr() *DocumentsInit200ResponseResumedUploadPresignedPresignedMethod { +func (d DocumentsList200ResponseDocumentsItemState) Ptr() *DocumentsList200ResponseDocumentsItemState { + return &d +} + +type DocumentsList200ResponseDocumentsItemThumbnailState string + +const ( + DocumentsList200ResponseDocumentsItemThumbnailStatePending DocumentsList200ResponseDocumentsItemThumbnailState = "pending" + DocumentsList200ResponseDocumentsItemThumbnailStateReady DocumentsList200ResponseDocumentsItemThumbnailState = "ready" + DocumentsList200ResponseDocumentsItemThumbnailStateLocked DocumentsList200ResponseDocumentsItemThumbnailState = "locked" + DocumentsList200ResponseDocumentsItemThumbnailStateFailed DocumentsList200ResponseDocumentsItemThumbnailState = "failed" +) + +func NewDocumentsList200ResponseDocumentsItemThumbnailStateFromString(s string) (DocumentsList200ResponseDocumentsItemThumbnailState, error) { + switch s { + case "pending": + return DocumentsList200ResponseDocumentsItemThumbnailStatePending, nil + case "ready": + return DocumentsList200ResponseDocumentsItemThumbnailStateReady, nil + case "locked": + return DocumentsList200ResponseDocumentsItemThumbnailStateLocked, nil + case "failed": + return DocumentsList200ResponseDocumentsItemThumbnailStateFailed, nil + } + var t DocumentsList200ResponseDocumentsItemThumbnailState + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsList200ResponseDocumentsItemThumbnailState) Ptr() *DocumentsList200ResponseDocumentsItemThumbnailState { return &d } var ( - documentsInit200ResponseResumedUploadProxyFieldURL = big.NewInt(1 << 0) - documentsInit200ResponseResumedUploadProxyFieldKey = big.NewInt(1 << 1) + documentsUploadProxy200ResponseFieldSha256 = big.NewInt(1 << 0) ) -type DocumentsInit200ResponseResumedUploadProxy struct { - URL string `json:"url" url:"url"` - Key string `json:"key" url:"key"` +type DocumentsUploadProxy200Response struct { + Sha256 string `json:"sha256" url:"sha256"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -3512,55 +4608,41 @@ type DocumentsInit200ResponseResumedUploadProxy struct { rawJSON json.RawMessage } -func (d *DocumentsInit200ResponseResumedUploadProxy) GetURL() string { - if d == nil { - return "" - } - return d.URL -} - -func (d *DocumentsInit200ResponseResumedUploadProxy) GetKey() string { +func (d *DocumentsUploadProxy200Response) GetSha256() string { if d == nil { return "" } - return d.Key + return d.Sha256 } -func (d *DocumentsInit200ResponseResumedUploadProxy) GetExtraProperties() map[string]interface{} { +func (d *DocumentsUploadProxy200Response) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsInit200ResponseResumedUploadProxy) require(field *big.Int) { +func (d *DocumentsUploadProxy200Response) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetURL sets the URL field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadProxy) SetURL(url string) { - d.URL = url - d.require(documentsInit200ResponseResumedUploadProxyFieldURL) -} - -// SetKey sets the Key field and marks it as non-optional; +// SetSha256 sets the Sha256 field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsInit200ResponseResumedUploadProxy) SetKey(key string) { - d.Key = key - d.require(documentsInit200ResponseResumedUploadProxyFieldKey) +func (d *DocumentsUploadProxy200Response) SetSha256(sha256 string) { + d.Sha256 = sha256 + d.require(documentsUploadProxy200ResponseFieldSha256) } -func (d *DocumentsInit200ResponseResumedUploadProxy) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsInit200ResponseResumedUploadProxy +func (d *DocumentsUploadProxy200Response) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsUploadProxy200Response var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsInit200ResponseResumedUploadProxy(value) + *d = DocumentsUploadProxy200Response(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -3570,8 +4652,8 @@ func (d *DocumentsInit200ResponseResumedUploadProxy) UnmarshalJSON(data []byte) return nil } -func (d *DocumentsInit200ResponseResumedUploadProxy) MarshalJSON() ([]byte, error) { - type embed DocumentsInit200ResponseResumedUploadProxy +func (d *DocumentsUploadProxy200Response) MarshalJSON() ([]byte, error) { + type embed DocumentsUploadProxy200Response var marshaler = struct { embed }{ @@ -3581,7 +4663,7 @@ func (d *DocumentsInit200ResponseResumedUploadProxy) MarshalJSON() ([]byte, erro return json.Marshal(explicitMarshaler) } -func (d *DocumentsInit200ResponseResumedUploadProxy) String() string { +func (d *DocumentsUploadProxy200Response) String() string { if d == nil { return "" } @@ -3596,14 +4678,36 @@ func (d *DocumentsInit200ResponseResumedUploadProxy) String() string { return fmt.Sprintf("%#v", d) } +type DocumentsImportFromRequestDedupMode string + +const ( + DocumentsImportFromRequestDedupModeAlwaysCreate DocumentsImportFromRequestDedupMode = "always-create" + DocumentsImportFromRequestDedupModeReuseExisting DocumentsImportFromRequestDedupMode = "reuse-existing" +) + +func NewDocumentsImportFromRequestDedupModeFromString(s string) (DocumentsImportFromRequestDedupMode, error) { + switch s { + case "always-create": + return DocumentsImportFromRequestDedupModeAlwaysCreate, nil + case "reuse-existing": + return DocumentsImportFromRequestDedupModeReuseExisting, nil + } + var t DocumentsImportFromRequestDedupMode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsImportFromRequestDedupMode) Ptr() *DocumentsImportFromRequestDedupMode { + return &d +} + var ( - documentsList200ResponseFieldDocuments = big.NewInt(1 << 0) - documentsList200ResponseFieldNextCursor = big.NewInt(1 << 1) + documentsImportFromRequestExpectedFieldSizeBytes = big.NewInt(1 << 0) + documentsImportFromRequestExpectedFieldSha256 = big.NewInt(1 << 1) ) -type DocumentsList200Response struct { - Documents []*DocumentsList200ResponseDocumentsItem `json:"documents" url:"documents"` - NextCursor *string `json:"nextCursor,omitempty" url:"nextCursor,omitempty"` +type DocumentsImportFromRequestExpected struct { + SizeBytes *int `json:"sizeBytes,omitempty" url:"sizeBytes,omitempty"` + Sha256 *string `json:"sha256,omitempty" url:"sha256,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -3612,55 +4716,55 @@ type DocumentsList200Response struct { rawJSON json.RawMessage } -func (d *DocumentsList200Response) GetDocuments() []*DocumentsList200ResponseDocumentsItem { +func (d *DocumentsImportFromRequestExpected) GetSizeBytes() *int { if d == nil { return nil } - return d.Documents + return d.SizeBytes } -func (d *DocumentsList200Response) GetNextCursor() *string { +func (d *DocumentsImportFromRequestExpected) GetSha256() *string { if d == nil { return nil } - return d.NextCursor + return d.Sha256 } -func (d *DocumentsList200Response) GetExtraProperties() map[string]interface{} { +func (d *DocumentsImportFromRequestExpected) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsList200Response) require(field *big.Int) { +func (d *DocumentsImportFromRequestExpected) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetDocuments sets the Documents field and marks it as non-optional; +// SetSizeBytes sets the SizeBytes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200Response) SetDocuments(documents []*DocumentsList200ResponseDocumentsItem) { - d.Documents = documents - d.require(documentsList200ResponseFieldDocuments) +func (d *DocumentsImportFromRequestExpected) SetSizeBytes(sizeBytes *int) { + d.SizeBytes = sizeBytes + d.require(documentsImportFromRequestExpectedFieldSizeBytes) } -// SetNextCursor sets the NextCursor field and marks it as non-optional; +// SetSha256 sets the Sha256 field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200Response) SetNextCursor(nextCursor *string) { - d.NextCursor = nextCursor - d.require(documentsList200ResponseFieldNextCursor) +func (d *DocumentsImportFromRequestExpected) SetSha256(sha256 *string) { + d.Sha256 = sha256 + d.require(documentsImportFromRequestExpectedFieldSha256) } -func (d *DocumentsList200Response) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsList200Response +func (d *DocumentsImportFromRequestExpected) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFromRequestExpected var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsList200Response(value) + *d = DocumentsImportFromRequestExpected(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -3670,8 +4774,8 @@ func (d *DocumentsList200Response) UnmarshalJSON(data []byte) error { return nil } -func (d *DocumentsList200Response) MarshalJSON() ([]byte, error) { - type embed DocumentsList200Response +func (d *DocumentsImportFromRequestExpected) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFromRequestExpected var marshaler = struct { embed }{ @@ -3681,7 +4785,7 @@ func (d *DocumentsList200Response) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (d *DocumentsList200Response) String() string { +func (d *DocumentsImportFromRequestExpected) String() string { if d == nil { return "" } @@ -3696,247 +4800,235 @@ func (d *DocumentsList200Response) String() string { return fmt.Sprintf("%#v", d) } -var ( - documentsList200ResponseDocumentsItemFieldID = big.NewInt(1 << 0) - documentsList200ResponseDocumentsItemFieldTenantID = big.NewInt(1 << 1) - documentsList200ResponseDocumentsItemFieldState = big.NewInt(1 << 2) - documentsList200ResponseDocumentsItemFieldBaseSha = big.NewInt(1 << 3) - documentsList200ResponseDocumentsItemFieldStorageSizeBytes = big.NewInt(1 << 4) - documentsList200ResponseDocumentsItemFieldMetadata = big.NewInt(1 << 5) - documentsList200ResponseDocumentsItemFieldIdempotencyKey = big.NewInt(1 << 6) - documentsList200ResponseDocumentsItemFieldFailureReason = big.NewInt(1 << 7) - documentsList200ResponseDocumentsItemFieldThumbnailState = big.NewInt(1 << 8) - documentsList200ResponseDocumentsItemFieldThumbnailURL = big.NewInt(1 << 9) - documentsList200ResponseDocumentsItemFieldCreatedAt = big.NewInt(1 << 10) - documentsList200ResponseDocumentsItemFieldUpdatedAt = big.NewInt(1 << 11) - documentsList200ResponseDocumentsItemFieldCreatedBy = big.NewInt(1 << 12) +type DocumentsImportFromRequestMode string + +const ( + DocumentsImportFromRequestModeSync DocumentsImportFromRequestMode = "sync" + DocumentsImportFromRequestModeAsync DocumentsImportFromRequestMode = "async" ) -type DocumentsList200ResponseDocumentsItem struct { - ID string `json:"id" url:"id"` - TenantID string `json:"tenantId" url:"tenantId"` - State DocumentsList200ResponseDocumentsItemState `json:"state" url:"state"` - BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` - StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` - Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` - IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` - FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` - ThumbnailState *DocumentsList200ResponseDocumentsItemThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` - ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` - CreatedAt float64 `json:"createdAt" url:"createdAt"` - UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` - CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` +func NewDocumentsImportFromRequestModeFromString(s string) (DocumentsImportFromRequestMode, error) { + switch s { + case "sync": + return DocumentsImportFromRequestModeSync, nil + case "async": + return DocumentsImportFromRequestModeAsync, nil + } + var t DocumentsImportFromRequestMode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (d DocumentsImportFromRequestMode) Ptr() *DocumentsImportFromRequestMode { + return &d +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +type DocumentsImportFromRequestSource struct { + Kind string + URL *DocumentsImportFromRequestSourceURL + Connection *DocumentsImportFromRequestSourceConnection + + rawJSON json.RawMessage } -func (d *DocumentsList200ResponseDocumentsItem) GetID() string { +func (d *DocumentsImportFromRequestSource) GetKind() string { if d == nil { return "" } - return d.ID + return d.Kind } -func (d *DocumentsList200ResponseDocumentsItem) GetTenantID() string { +func (d *DocumentsImportFromRequestSource) GetURL() *DocumentsImportFromRequestSourceURL { if d == nil { - return "" + return nil } - return d.TenantID + return d.URL } -func (d *DocumentsList200ResponseDocumentsItem) GetState() DocumentsList200ResponseDocumentsItemState { +func (d *DocumentsImportFromRequestSource) GetConnection() *DocumentsImportFromRequestSourceConnection { if d == nil { - return "" + return nil } - return d.State + return d.Connection } -func (d *DocumentsList200ResponseDocumentsItem) GetBaseSha() *string { - if d == nil { - return nil +func (d *DocumentsImportFromRequestSource) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + Kind string `json:"kind"` + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + d.Kind = unmarshaler.Kind + if unmarshaler.Kind == "" { + return fmt.Errorf("%T did not include discriminant kind", d) + } + switch unmarshaler.Kind { + case "url": + value := new(DocumentsImportFromRequestSourceURL) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + d.URL = value + case "connection": + value := new(DocumentsImportFromRequestSourceConnection) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + d.Connection = value } - return d.BaseSha + d.rawJSON = json.RawMessage(data) + return nil } -func (d *DocumentsList200ResponseDocumentsItem) GetStorageSizeBytes() *float64 { - if d == nil { - return nil +func (d DocumentsImportFromRequestSource) MarshalJSON() ([]byte, error) { + if err := d.validate(); err != nil { + return nil, err } - return d.StorageSizeBytes -} - -func (d *DocumentsList200ResponseDocumentsItem) GetMetadata() map[string]any { - if d == nil { - return nil + if d.URL != nil { + return internal.MarshalJSONWithExtraProperty(d.URL, "kind", "url") } - return d.Metadata + if d.Connection != nil { + return internal.MarshalJSONWithExtraProperty(d.Connection, "kind", "connection") + } + if len(d.rawJSON) > 0 { + return d.rawJSON, nil + } + return nil, fmt.Errorf("type %T does not define a non-empty union type", d) } -func (d *DocumentsList200ResponseDocumentsItem) GetIdempotencyKey() *string { - if d == nil { - return nil - } - return d.IdempotencyKey +type DocumentsImportFromRequestSourceVisitor interface { + VisitURL(*DocumentsImportFromRequestSourceURL) error + VisitConnection(*DocumentsImportFromRequestSourceConnection) error } -func (d *DocumentsList200ResponseDocumentsItem) GetFailureReason() *string { - if d == nil { - return nil +func (d *DocumentsImportFromRequestSource) Accept(visitor DocumentsImportFromRequestSourceVisitor) error { + if d.URL != nil { + return visitor.VisitURL(d.URL) } - return d.FailureReason + if d.Connection != nil { + return visitor.VisitConnection(d.Connection) + } + return fmt.Errorf("type %T does not define a non-empty union type", d) } -func (d *DocumentsList200ResponseDocumentsItem) GetThumbnailState() *DocumentsList200ResponseDocumentsItemThumbnailState { +func (d *DocumentsImportFromRequestSource) validate() error { if d == nil { - return nil + return fmt.Errorf("type %T is nil", d) } - return d.ThumbnailState + var fields []string + if d.URL != nil { + fields = append(fields, "url") + } + if d.Connection != nil { + fields = append(fields, "connection") + } + if len(fields) == 0 { + if d.Kind != "" { + if len(d.rawJSON) > 0 { + return nil + } + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", d, d.Kind) + } + return fmt.Errorf("type %T is empty", d) + } + if len(fields) > 1 { + return fmt.Errorf("type %T defines values for %s, but only one value is allowed", d, fields) + } + if d.Kind != "" { + field := fields[0] + if d.Kind != field { + return fmt.Errorf( + "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", + d, + d.Kind, + d, + ) + } + } + return nil } -func (d *DocumentsList200ResponseDocumentsItem) GetThumbnailURL() *string { - if d == nil { - return nil - } - return d.ThumbnailURL +var ( + documentsImportFromRequestSourceConnectionFieldConnectionID = big.NewInt(1 << 0) + documentsImportFromRequestSourceConnectionFieldKey = big.NewInt(1 << 1) + documentsImportFromRequestSourceConnectionFieldRevision = big.NewInt(1 << 2) +) + +type DocumentsImportFromRequestSourceConnection struct { + ConnectionID string `json:"connectionId" url:"connectionId"` + Key string `json:"key" url:"key"` + Revision *string `json:"revision,omitempty" url:"revision,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (d *DocumentsList200ResponseDocumentsItem) GetCreatedAt() float64 { +func (d *DocumentsImportFromRequestSourceConnection) GetConnectionID() string { if d == nil { - return 0 + return "" } - return d.CreatedAt + return d.ConnectionID } -func (d *DocumentsList200ResponseDocumentsItem) GetUpdatedAt() float64 { +func (d *DocumentsImportFromRequestSourceConnection) GetKey() string { if d == nil { - return 0 + return "" } - return d.UpdatedAt + return d.Key } -func (d *DocumentsList200ResponseDocumentsItem) GetCreatedBy() *string { +func (d *DocumentsImportFromRequestSourceConnection) GetRevision() *string { if d == nil { return nil } - return d.CreatedBy + return d.Revision } -func (d *DocumentsList200ResponseDocumentsItem) GetExtraProperties() map[string]interface{} { +func (d *DocumentsImportFromRequestSourceConnection) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsList200ResponseDocumentsItem) require(field *big.Int) { +func (d *DocumentsImportFromRequestSourceConnection) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetID sets the ID field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetID(id string) { - d.ID = id - d.require(documentsList200ResponseDocumentsItemFieldID) -} - -// SetTenantID sets the TenantID field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetTenantID(tenantID string) { - d.TenantID = tenantID - d.require(documentsList200ResponseDocumentsItemFieldTenantID) -} - -// SetState sets the State field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetState(state DocumentsList200ResponseDocumentsItemState) { - d.State = state - d.require(documentsList200ResponseDocumentsItemFieldState) -} - -// SetBaseSha sets the BaseSha field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetBaseSha(baseSha *string) { - d.BaseSha = baseSha - d.require(documentsList200ResponseDocumentsItemFieldBaseSha) -} - -// SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetStorageSizeBytes(storageSizeBytes *float64) { - d.StorageSizeBytes = storageSizeBytes - d.require(documentsList200ResponseDocumentsItemFieldStorageSizeBytes) -} - -// SetMetadata sets the Metadata field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetMetadata(metadata map[string]any) { - d.Metadata = metadata - d.require(documentsList200ResponseDocumentsItemFieldMetadata) -} - -// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetIdempotencyKey(idempotencyKey *string) { - d.IdempotencyKey = idempotencyKey - d.require(documentsList200ResponseDocumentsItemFieldIdempotencyKey) -} - -// SetFailureReason sets the FailureReason field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetFailureReason(failureReason *string) { - d.FailureReason = failureReason - d.require(documentsList200ResponseDocumentsItemFieldFailureReason) -} - -// SetThumbnailState sets the ThumbnailState field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetThumbnailState(thumbnailState *DocumentsList200ResponseDocumentsItemThumbnailState) { - d.ThumbnailState = thumbnailState - d.require(documentsList200ResponseDocumentsItemFieldThumbnailState) -} - -// SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetThumbnailURL(thumbnailURL *string) { - d.ThumbnailURL = thumbnailURL - d.require(documentsList200ResponseDocumentsItemFieldThumbnailURL) -} - -// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// SetConnectionID sets the ConnectionID field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetCreatedAt(createdAt float64) { - d.CreatedAt = createdAt - d.require(documentsList200ResponseDocumentsItemFieldCreatedAt) +func (d *DocumentsImportFromRequestSourceConnection) SetConnectionID(connectionID string) { + d.ConnectionID = connectionID + d.require(documentsImportFromRequestSourceConnectionFieldConnectionID) } -// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// SetKey sets the Key field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetUpdatedAt(updatedAt float64) { - d.UpdatedAt = updatedAt - d.require(documentsList200ResponseDocumentsItemFieldUpdatedAt) +func (d *DocumentsImportFromRequestSourceConnection) SetKey(key string) { + d.Key = key + d.require(documentsImportFromRequestSourceConnectionFieldKey) } -// SetCreatedBy sets the CreatedBy field and marks it as non-optional; +// SetRevision sets the Revision field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsList200ResponseDocumentsItem) SetCreatedBy(createdBy *string) { - d.CreatedBy = createdBy - d.require(documentsList200ResponseDocumentsItemFieldCreatedBy) +func (d *DocumentsImportFromRequestSourceConnection) SetRevision(revision *string) { + d.Revision = revision + d.require(documentsImportFromRequestSourceConnectionFieldRevision) } -func (d *DocumentsList200ResponseDocumentsItem) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsList200ResponseDocumentsItem +func (d *DocumentsImportFromRequestSourceConnection) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFromRequestSourceConnection var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsList200ResponseDocumentsItem(value) + *d = DocumentsImportFromRequestSourceConnection(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -3946,8 +5038,8 @@ func (d *DocumentsList200ResponseDocumentsItem) UnmarshalJSON(data []byte) error return nil } -func (d *DocumentsList200ResponseDocumentsItem) MarshalJSON() ([]byte, error) { - type embed DocumentsList200ResponseDocumentsItem +func (d *DocumentsImportFromRequestSourceConnection) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFromRequestSourceConnection var marshaler = struct { embed }{ @@ -3957,7 +5049,7 @@ func (d *DocumentsList200ResponseDocumentsItem) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (d *DocumentsList200ResponseDocumentsItem) String() string { +func (d *DocumentsImportFromRequestSourceConnection) String() string { if d == nil { return "" } @@ -3972,68 +5064,12 @@ func (d *DocumentsList200ResponseDocumentsItem) String() string { return fmt.Sprintf("%#v", d) } -type DocumentsList200ResponseDocumentsItemState string - -const ( - DocumentsList200ResponseDocumentsItemStatePending DocumentsList200ResponseDocumentsItemState = "pending" - DocumentsList200ResponseDocumentsItemStateReady DocumentsList200ResponseDocumentsItemState = "ready" - DocumentsList200ResponseDocumentsItemStateFailed DocumentsList200ResponseDocumentsItemState = "failed" - DocumentsList200ResponseDocumentsItemStateDeleting DocumentsList200ResponseDocumentsItemState = "deleting" -) - -func NewDocumentsList200ResponseDocumentsItemStateFromString(s string) (DocumentsList200ResponseDocumentsItemState, error) { - switch s { - case "pending": - return DocumentsList200ResponseDocumentsItemStatePending, nil - case "ready": - return DocumentsList200ResponseDocumentsItemStateReady, nil - case "failed": - return DocumentsList200ResponseDocumentsItemStateFailed, nil - case "deleting": - return DocumentsList200ResponseDocumentsItemStateDeleting, nil - } - var t DocumentsList200ResponseDocumentsItemState - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (d DocumentsList200ResponseDocumentsItemState) Ptr() *DocumentsList200ResponseDocumentsItemState { - return &d -} - -type DocumentsList200ResponseDocumentsItemThumbnailState string - -const ( - DocumentsList200ResponseDocumentsItemThumbnailStatePending DocumentsList200ResponseDocumentsItemThumbnailState = "pending" - DocumentsList200ResponseDocumentsItemThumbnailStateReady DocumentsList200ResponseDocumentsItemThumbnailState = "ready" - DocumentsList200ResponseDocumentsItemThumbnailStateLocked DocumentsList200ResponseDocumentsItemThumbnailState = "locked" - DocumentsList200ResponseDocumentsItemThumbnailStateFailed DocumentsList200ResponseDocumentsItemThumbnailState = "failed" -) - -func NewDocumentsList200ResponseDocumentsItemThumbnailStateFromString(s string) (DocumentsList200ResponseDocumentsItemThumbnailState, error) { - switch s { - case "pending": - return DocumentsList200ResponseDocumentsItemThumbnailStatePending, nil - case "ready": - return DocumentsList200ResponseDocumentsItemThumbnailStateReady, nil - case "locked": - return DocumentsList200ResponseDocumentsItemThumbnailStateLocked, nil - case "failed": - return DocumentsList200ResponseDocumentsItemThumbnailStateFailed, nil - } - var t DocumentsList200ResponseDocumentsItemThumbnailState - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (d DocumentsList200ResponseDocumentsItemThumbnailState) Ptr() *DocumentsList200ResponseDocumentsItemThumbnailState { - return &d -} - var ( - documentsUploadProxy200ResponseFieldSha256 = big.NewInt(1 << 0) + documentsImportFromRequestSourceURLFieldURL = big.NewInt(1 << 0) ) -type DocumentsUploadProxy200Response struct { - Sha256 string `json:"sha256" url:"sha256"` +type DocumentsImportFromRequestSourceURL struct { + URL string `json:"url" url:"url"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -4042,41 +5078,41 @@ type DocumentsUploadProxy200Response struct { rawJSON json.RawMessage } -func (d *DocumentsUploadProxy200Response) GetSha256() string { +func (d *DocumentsImportFromRequestSourceURL) GetURL() string { if d == nil { return "" } - return d.Sha256 + return d.URL } -func (d *DocumentsUploadProxy200Response) GetExtraProperties() map[string]interface{} { +func (d *DocumentsImportFromRequestSourceURL) GetExtraProperties() map[string]interface{} { if d == nil { return nil } return d.extraProperties } -func (d *DocumentsUploadProxy200Response) require(field *big.Int) { +func (d *DocumentsImportFromRequestSourceURL) require(field *big.Int) { if d.explicitFields == nil { d.explicitFields = big.NewInt(0) } d.explicitFields.Or(d.explicitFields, field) } -// SetSha256 sets the Sha256 field and marks it as non-optional; +// SetURL sets the URL field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (d *DocumentsUploadProxy200Response) SetSha256(sha256 string) { - d.Sha256 = sha256 - d.require(documentsUploadProxy200ResponseFieldSha256) +func (d *DocumentsImportFromRequestSourceURL) SetURL(url string) { + d.URL = url + d.require(documentsImportFromRequestSourceURLFieldURL) } -func (d *DocumentsUploadProxy200Response) UnmarshalJSON(data []byte) error { - type unmarshaler DocumentsUploadProxy200Response +func (d *DocumentsImportFromRequestSourceURL) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFromRequestSourceURL var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *d = DocumentsUploadProxy200Response(value) + *d = DocumentsImportFromRequestSourceURL(value) extraProperties, err := internal.ExtractExtraProperties(data, *d) if err != nil { return err @@ -4086,8 +5122,8 @@ func (d *DocumentsUploadProxy200Response) UnmarshalJSON(data []byte) error { return nil } -func (d *DocumentsUploadProxy200Response) MarshalJSON() ([]byte, error) { - type embed DocumentsUploadProxy200Response +func (d *DocumentsImportFromRequestSourceURL) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFromRequestSourceURL var marshaler = struct { embed }{ @@ -4097,7 +5133,7 @@ func (d *DocumentsUploadProxy200Response) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (d *DocumentsUploadProxy200Response) String() string { +func (d *DocumentsImportFromRequestSourceURL) String() string { if d == nil { return "" } diff --git a/documents/client.go b/documents/client.go index e541817..a586d52 100644 --- a/documents/client.go +++ b/documents/client.go @@ -222,6 +222,38 @@ func (c *Client) UploadProxy( return response.Body, nil } +// Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id). +// +// Example: +// +// request := &cloudpdf.DocumentsImportFromRequest{ +// TenantID: "tenantId", +// Source: &cloudpdf.DocumentsImportFromRequestSource{ +// URL: &cloudpdf.DocumentsImportFromRequestSourceURL{ +// URL: "url", +// }, +// }, +// } +// client.Documents.ImportFrom( +// context.TODO(), +// request, +// ) +func (c *Client) ImportFrom( + ctx context.Context, + request *cloudpdf.DocumentsImportFromRequest, + opts ...option.RequestOption, +) (*cloudpdf.DocumentsImportFrom200Response, error) { + response, err := c.WithRawResponse.ImportFrom( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + // Example: // // request := &cloudpdf.DocumentsInitRequest{ diff --git a/documents/documents_test/documents_test.go b/documents/documents_test/documents_test.go index ac79d64..d027c49 100644 --- a/documents/documents_test/documents_test.go +++ b/documents/documents_test/documents_test.go @@ -216,6 +216,37 @@ func TestDocumentsUploadProxyWithWireMock( VerifyRequestCount(t, "TestDocumentsUploadProxyWithWireMock", "POST", "/v1/tenants/tenantId/documents/id/upload-proxy", nil, 1) } +func TestDocumentsImportFromWithWireMock( + t *testing.T, +) { + WireMockBaseURL := os.Getenv("WIREMOCK_URL") + if WireMockBaseURL == "" { + WireMockBaseURL = "http://localhost:8080" + } + client := client.NewClient( + option.WithBaseURL(WireMockBaseURL), + option.WithToken("test-token"), + ) + request := &cloudpdf.DocumentsImportFromRequest{ + TenantID: "tenantId", + Source: &cloudpdf.DocumentsImportFromRequestSource{ + URL: &cloudpdf.DocumentsImportFromRequestSourceURL{ + URL: "url", + }, + }, + } + _, invocationErr := client.Documents.ImportFrom( + context.TODO(), + request, + option.WithHTTPHeader( + http.Header{"X-Test-Id": []string{"TestDocumentsImportFromWithWireMock"}}, + ), + ) + + require.NoError(t, invocationErr, "Client method call should succeed") + VerifyRequestCount(t, "TestDocumentsImportFromWithWireMock", "POST", "/v1/tenants/tenantId/documents/import", nil, 1) +} + func TestDocumentsInitWithWireMock( t *testing.T, ) { diff --git a/documents/raw_client.go b/documents/raw_client.go index a3e8865..f24a8e7 100644 --- a/documents/raw_client.go +++ b/documents/raw_client.go @@ -372,6 +372,53 @@ func (r *RawClient) UploadProxy( }, nil } +func (r *RawClient) ImportFrom( + ctx context.Context, + request *cloudpdf.DocumentsImportFromRequest, + opts ...option.RequestOption, +) (*core.Response[*cloudpdf.DocumentsImportFrom200Response], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v1/tenants/%v/documents/import", + request.TenantID, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *cloudpdf.DocumentsImportFrom200Response + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + DisableRetries: options.DisableRetries, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(cloudpdf.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*cloudpdf.DocumentsImportFrom200Response]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + func (r *RawClient) Init( ctx context.Context, request *cloudpdf.DocumentsInitRequest, diff --git a/documents_test.go b/documents_test.go index 7c4cccf..3f162d9 100644 --- a/documents_test.go +++ b/documents_test.go @@ -384,33 +384,33 @@ func TestSettersMarkExplicitGetDocumentsRequest(t *testing.T) { } -func TestSettersDocumentsInitRequest(t *testing.T) { +func TestSettersDocumentsImportFromRequest(t *testing.T) { t.Run("SetTenantID", func(t *testing.T) { - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueTenantID string obj.SetTenantID(fernTestValueTenantID) assert.Equal(t, fernTestValueTenantID, obj.TenantID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentLength", func(t *testing.T) { - obj := &DocumentsInitRequest{} - var fernTestValueContentLength float64 - obj.SetContentLength(fernTestValueContentLength) - assert.Equal(t, fernTestValueContentLength, obj.ContentLength) + t.Run("SetSource", func(t *testing.T) { + obj := &DocumentsImportFromRequest{} + var fernTestValueSource *DocumentsImportFromRequestSource + obj.SetSource(fernTestValueSource) + assert.Equal(t, fernTestValueSource, obj.Source) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetContentSha256", func(t *testing.T) { - obj := &DocumentsInitRequest{} - var fernTestValueContentSha256 string - obj.SetContentSha256(fernTestValueContentSha256) - assert.Equal(t, fernTestValueContentSha256, obj.ContentSha256) + t.Run("SetExpected", func(t *testing.T) { + obj := &DocumentsImportFromRequest{} + var fernTestValueExpected *DocumentsImportFromRequestExpected + obj.SetExpected(fernTestValueExpected) + assert.Equal(t, fernTestValueExpected, obj.Expected) assert.NotNil(t, obj.explicitFields) }) t.Run("SetMetadata", func(t *testing.T) { - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueMetadata map[string]any obj.SetMetadata(fernTestValueMetadata) assert.Equal(t, fernTestValueMetadata, obj.Metadata) @@ -418,7 +418,7 @@ func TestSettersDocumentsInitRequest(t *testing.T) { }) t.Run("SetIdempotencyKey", func(t *testing.T) { - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueIdempotencyKey *string obj.SetIdempotencyKey(fernTestValueIdempotencyKey) assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) @@ -426,44 +426,36 @@ func TestSettersDocumentsInitRequest(t *testing.T) { }) t.Run("SetDedupMode", func(t *testing.T) { - obj := &DocumentsInitRequest{} - var fernTestValueDedupMode *DocumentsInitRequestDedupMode + obj := &DocumentsImportFromRequest{} + var fernTestValueDedupMode *DocumentsImportFromRequestDedupMode obj.SetDedupMode(fernTestValueDedupMode) assert.Equal(t, fernTestValueDedupMode, obj.DedupMode) assert.NotNil(t, obj.explicitFields) }) t.Run("SetDocID", func(t *testing.T) { - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueDocID *string obj.SetDocID(fernTestValueDocID) assert.Equal(t, fernTestValueDocID, obj.DocID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUploadTTLSec", func(t *testing.T) { - obj := &DocumentsInitRequest{} - var fernTestValueUploadTTLSec *float64 - obj.SetUploadTTLSec(fernTestValueUploadTTLSec) - assert.Equal(t, fernTestValueUploadTTLSec, obj.UploadTTLSec) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUploadPreference", func(t *testing.T) { - obj := &DocumentsInitRequest{} - var fernTestValueUploadPreference *DocumentsInitRequestUploadPreference - obj.SetUploadPreference(fernTestValueUploadPreference) - assert.Equal(t, fernTestValueUploadPreference, obj.UploadPreference) + t.Run("SetMode", func(t *testing.T) { + obj := &DocumentsImportFromRequest{} + var fernTestValueMode *DocumentsImportFromRequestMode + obj.SetMode(fernTestValueMode) + assert.Equal(t, fernTestValueMode, obj.Mode) assert.NotNil(t, obj.explicitFields) }) } -func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { +func TestSettersMarkExplicitDocumentsImportFromRequest(t *testing.T) { t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueTenantID string // Act @@ -491,14 +483,14 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentLength_MarksExplicit", func(t *testing.T) { + t.Run("SetSource_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} - var fernTestValueContentLength float64 + obj := &DocumentsImportFromRequest{} + var fernTestValueSource *DocumentsImportFromRequestSource // Act - obj.SetContentLength(fernTestValueContentLength) + obj.SetSource(fernTestValueSource) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -522,14 +514,14 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetContentSha256_MarksExplicit", func(t *testing.T) { + t.Run("SetExpected_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} - var fernTestValueContentSha256 string + obj := &DocumentsImportFromRequest{} + var fernTestValueExpected *DocumentsImportFromRequestExpected // Act - obj.SetContentSha256(fernTestValueContentSha256) + obj.SetExpected(fernTestValueExpected) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -556,7 +548,7 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueMetadata map[string]any // Act @@ -587,7 +579,7 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueIdempotencyKey *string // Act @@ -618,8 +610,8 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { t.Run("SetDedupMode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} - var fernTestValueDedupMode *DocumentsInitRequestDedupMode + obj := &DocumentsImportFromRequest{} + var fernTestValueDedupMode *DocumentsImportFromRequestDedupMode // Act obj.SetDedupMode(fernTestValueDedupMode) @@ -649,7 +641,7 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { t.Run("SetDocID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} + obj := &DocumentsImportFromRequest{} var fernTestValueDocID *string // Act @@ -677,14 +669,14 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUploadTTLSec_MarksExplicit", func(t *testing.T) { + t.Run("SetMode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInitRequest{} - var fernTestValueUploadTTLSec *float64 + obj := &DocumentsImportFromRequest{} + var fernTestValueMode *DocumentsImportFromRequestMode // Act - obj.SetUploadTTLSec(fernTestValueUploadTTLSec) + obj.SetMode(fernTestValueMode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -708,79 +700,88 @@ func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUploadPreference_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInitRequest{} - var fernTestValueUploadPreference *DocumentsInitRequestUploadPreference +} - // Act - obj.SetUploadPreference(fernTestValueUploadPreference) +func TestSettersDocumentsInitRequest(t *testing.T) { + t.Run("SetTenantID", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetContentLength", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueContentLength float64 + obj.SetContentLength(fernTestValueContentLength) + assert.Equal(t, fernTestValueContentLength, obj.ContentLength) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetContentSha256", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueContentSha256 string + obj.SetContentSha256(fernTestValueContentSha256) + assert.Equal(t, fernTestValueContentSha256, obj.ContentSha256) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetMetadata", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueMetadata map[string]any + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) }) -} + t.Run("SetIdempotencyKey", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueIdempotencyKey *string + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + assert.NotNil(t, obj.explicitFields) + }) -func TestSettersListDocumentsRequest(t *testing.T) { - t.Run("SetTenantID", func(t *testing.T) { - obj := &ListDocumentsRequest{} - var fernTestValueTenantID string - obj.SetTenantID(fernTestValueTenantID) - assert.Equal(t, fernTestValueTenantID, obj.TenantID) + t.Run("SetDedupMode", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueDedupMode *DocumentsInitRequestDedupMode + obj.SetDedupMode(fernTestValueDedupMode) + assert.Equal(t, fernTestValueDedupMode, obj.DedupMode) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetLimit", func(t *testing.T) { - obj := &ListDocumentsRequest{} - var fernTestValueLimit *int - obj.SetLimit(fernTestValueLimit) - assert.Equal(t, fernTestValueLimit, obj.Limit) + t.Run("SetDocID", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueDocID *string + obj.SetDocID(fernTestValueDocID) + assert.Equal(t, fernTestValueDocID, obj.DocID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCursor", func(t *testing.T) { - obj := &ListDocumentsRequest{} - var fernTestValueCursor *string - obj.SetCursor(fernTestValueCursor) - assert.Equal(t, fernTestValueCursor, obj.Cursor) + t.Run("SetUploadTTLSec", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueUploadTTLSec *float64 + obj.SetUploadTTLSec(fernTestValueUploadTTLSec) + assert.Equal(t, fernTestValueUploadTTLSec, obj.UploadTTLSec) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetState", func(t *testing.T) { - obj := &ListDocumentsRequest{} - var fernTestValueState *ListDocumentsRequestState - obj.SetState(fernTestValueState) - assert.Equal(t, fernTestValueState, obj.State) + t.Run("SetUploadPreference", func(t *testing.T) { + obj := &DocumentsInitRequest{} + var fernTestValueUploadPreference *DocumentsInitRequestUploadPreference + obj.SetUploadPreference(fernTestValueUploadPreference) + assert.Equal(t, fernTestValueUploadPreference, obj.UploadPreference) assert.NotNil(t, obj.explicitFields) }) } -func TestSettersMarkExplicitListDocumentsRequest(t *testing.T) { +func TestSettersMarkExplicitDocumentsInitRequest(t *testing.T) { t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ListDocumentsRequest{} + obj := &DocumentsInitRequest{} var fernTestValueTenantID string // Act @@ -808,14 +809,14 @@ func TestSettersMarkExplicitListDocumentsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetLimit_MarksExplicit", func(t *testing.T) { + t.Run("SetContentLength_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ListDocumentsRequest{} - var fernTestValueLimit *int + obj := &DocumentsInitRequest{} + var fernTestValueContentLength float64 // Act - obj.SetLimit(fernTestValueLimit) + obj.SetContentLength(fernTestValueContentLength) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -839,14 +840,14 @@ func TestSettersMarkExplicitListDocumentsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCursor_MarksExplicit", func(t *testing.T) { + t.Run("SetContentSha256_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ListDocumentsRequest{} - var fernTestValueCursor *string + obj := &DocumentsInitRequest{} + var fernTestValueContentSha256 string // Act - obj.SetCursor(fernTestValueCursor) + obj.SetContentSha256(fernTestValueContentSha256) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -870,14 +871,14 @@ func TestSettersMarkExplicitListDocumentsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetState_MarksExplicit", func(t *testing.T) { + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ListDocumentsRequest{} - var fernTestValueState *ListDocumentsRequestState + obj := &DocumentsInitRequest{} + var fernTestValueMetadata map[string]any // Act - obj.SetState(fernTestValueState) + obj.SetMetadata(fernTestValueMetadata) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -901,36 +902,14 @@ func TestSettersMarkExplicitListDocumentsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersThumbnailDocumentsRequest(t *testing.T) { - t.Run("SetTenantID", func(t *testing.T) { - obj := &ThumbnailDocumentsRequest{} - var fernTestValueTenantID string - obj.SetTenantID(fernTestValueTenantID) - assert.Equal(t, fernTestValueTenantID, obj.TenantID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetID", func(t *testing.T) { - obj := &ThumbnailDocumentsRequest{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestSettersMarkExplicitThumbnailDocumentsRequest(t *testing.T) { - t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ThumbnailDocumentsRequest{} - var fernTestValueTenantID string + obj := &DocumentsInitRequest{} + var fernTestValueIdempotencyKey *string // Act - obj.SetTenantID(fernTestValueTenantID) + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -954,14 +933,14 @@ func TestSettersMarkExplicitThumbnailDocumentsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Run("SetDedupMode_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &ThumbnailDocumentsRequest{} - var fernTestValueID string + obj := &DocumentsInitRequest{} + var fernTestValueDedupMode *DocumentsInitRequestDedupMode // Act - obj.SetID(fernTestValueID) + obj.SetDedupMode(fernTestValueDedupMode) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -985,64 +964,45 @@ func TestSettersMarkExplicitThumbnailDocumentsRequest(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDocumentsCommit200Response(t *testing.T) { - t.Run("SetDocument", func(t *testing.T) { - obj := &DocumentsCommit200Response{} - var fernTestValueDocument *DocumentsCommit200ResponseDocument - obj.SetDocument(fernTestValueDocument) - assert.Equal(t, fernTestValueDocument, obj.Document) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDocumentsCommit200Response(t *testing.T) { - t.Run("GetDocument", func(t *testing.T) { + t.Run("SetDocID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200Response{} - var expected *DocumentsCommit200ResponseDocument - obj.Document = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") - }) + obj := &DocumentsInitRequest{} + var fernTestValueDocID *string - t.Run("GetDocument_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsCommit200Response{} - obj.Document = nil + // Act + obj.SetDocID(fernTestValueDocID) - // Act & Assert - assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetDocument_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsCommit200Response - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDocument() // Should return zero value - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -} + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) -func TestSettersMarkExplicitDocumentsCommit200Response(t *testing.T) { - t.Run("SetDocument_MarksExplicit", func(t *testing.T) { + t.Run("SetUploadTTLSec_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200Response{} - var fernTestValueDocument *DocumentsCommit200ResponseDocument + obj := &DocumentsInitRequest{} + var fernTestValueUploadTTLSec *float64 // Act - obj.SetDocument(fernTestValueDocument) + obj.SetUploadTTLSec(fernTestValueUploadTTLSec) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -1066,339 +1026,486 @@ func TestSettersMarkExplicitDocumentsCommit200Response(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetUploadPreference_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInitRequest{} + var fernTestValueUploadPreference *DocumentsInitRequestUploadPreference -func TestSettersDocumentsCommit200ResponseDocument(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) + // Act + obj.SetUploadPreference(fernTestValueUploadPreference) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) +} + +func TestSettersListDocumentsRequest(t *testing.T) { t.Run("SetTenantID", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} + obj := &ListDocumentsRequest{} var fernTestValueTenantID string obj.SetTenantID(fernTestValueTenantID) assert.Equal(t, fernTestValueTenantID, obj.TenantID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetState", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueState DocumentsCommit200ResponseDocumentState - obj.SetState(fernTestValueState) - assert.Equal(t, fernTestValueState, obj.State) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBaseSha", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueBaseSha *string - obj.SetBaseSha(fernTestValueBaseSha) - assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStorageSizeBytes", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueStorageSizeBytes *float64 - obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) - assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) + t.Run("SetLimit", func(t *testing.T) { + obj := &ListDocumentsRequest{} + var fernTestValueLimit *int + obj.SetLimit(fernTestValueLimit) + assert.Equal(t, fernTestValueLimit, obj.Limit) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMetadata", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueMetadata map[string]any - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) + t.Run("SetCursor", func(t *testing.T) { + obj := &ListDocumentsRequest{} + var fernTestValueCursor *string + obj.SetCursor(fernTestValueCursor) + assert.Equal(t, fernTestValueCursor, obj.Cursor) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetIdempotencyKey", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueIdempotencyKey *string - obj.SetIdempotencyKey(fernTestValueIdempotencyKey) - assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + t.Run("SetState", func(t *testing.T) { + obj := &ListDocumentsRequest{} + var fernTestValueState *ListDocumentsRequestState + obj.SetState(fernTestValueState) + assert.Equal(t, fernTestValueState, obj.State) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetFailureReason", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueFailureReason *string - obj.SetFailureReason(fernTestValueFailureReason) - assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) - assert.NotNil(t, obj.explicitFields) - }) +} - t.Run("SetThumbnailState", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueThumbnailState *DocumentsCommit200ResponseDocumentThumbnailState - obj.SetThumbnailState(fernTestValueThumbnailState) - assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) - assert.NotNil(t, obj.explicitFields) - }) +func TestSettersMarkExplicitListDocumentsRequest(t *testing.T) { + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &ListDocumentsRequest{} + var fernTestValueTenantID string - t.Run("SetThumbnailURL", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueThumbnailURL *string - obj.SetThumbnailURL(fernTestValueThumbnailURL) - assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetTenantID(fernTestValueTenantID) - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueCreatedAt float64 - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueUpdatedAt float64 - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetCreatedBy", func(t *testing.T) { - obj := &DocumentsCommit200ResponseDocument{} - var fernTestValueCreatedBy *string - obj.SetCreatedBy(fernTestValueCreatedBy) - assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { - t.Run("GetID", func(t *testing.T) { + t.Run("SetLimit_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected string - obj.ID = expected + obj := &ListDocumentsRequest{} + var fernTestValueLimit *int - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") - }) + // Act + obj.SetLimit(fernTestValueLimit) - t.Run("GetID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsCommit200ResponseDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetTenantID", func(t *testing.T) { + t.Run("SetCursor_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected string - obj.TenantID = expected + obj := &ListDocumentsRequest{} + var fernTestValueCursor *string - // Act & Assert - assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") - }) + // Act + obj.SetCursor(fernTestValueCursor) - t.Run("GetTenantID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsCommit200ResponseDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTenantID() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetState", func(t *testing.T) { + t.Run("SetState_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected DocumentsCommit200ResponseDocumentState - obj.State = expected + obj := &ListDocumentsRequest{} + var fernTestValueState *ListDocumentsRequestState - // Act & Assert - assert.Equal(t, expected, obj.GetState(), "getter should return the property value") - }) + // Act + obj.SetState(fernTestValueState) - t.Run("GetState_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsCommit200ResponseDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetState() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetBaseSha", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected *string - obj.BaseSha = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetBaseSha_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsCommit200ResponseDocument{} - obj.BaseSha = nil +} - // Act & Assert - assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") +func TestSettersThumbnailDocumentsRequest(t *testing.T) { + t.Run("SetTenantID", func(t *testing.T) { + obj := &ThumbnailDocumentsRequest{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsCommit200ResponseDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetBaseSha() // Should return zero value + t.Run("SetID", func(t *testing.T) { + obj := &ThumbnailDocumentsRequest{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetStorageSizeBytes", func(t *testing.T) { +} + +func TestSettersMarkExplicitThumbnailDocumentsRequest(t *testing.T) { + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected *float64 - obj.StorageSizeBytes = expected + obj := &ThumbnailDocumentsRequest{} + var fernTestValueTenantID string - // Act & Assert - assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") - }) + // Act + obj.SetTenantID(fernTestValueTenantID) - t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsCommit200ResponseDocument{} - obj.StorageSizeBytes = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsCommit200ResponseDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStorageSizeBytes() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetMetadata", func(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected map[string]any - obj.Metadata = expected + obj := &ThumbnailDocumentsRequest{} + var fernTestValueID string - // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") - }) + // Act + obj.SetID(fernTestValueID) - t.Run("GetMetadata_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsCommit200ResponseDocument{} - obj.Metadata = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsCommit200ResponseDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMetadata() // Should return zero value +} + +func TestSettersDocumentsCommit200Response(t *testing.T) { + t.Run("SetDocument", func(t *testing.T) { + obj := &DocumentsCommit200Response{} + var fernTestValueDocument *DocumentsCommit200ResponseDocument + obj.SetDocument(fernTestValueDocument) + assert.Equal(t, fernTestValueDocument, obj.Document) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetIdempotencyKey", func(t *testing.T) { +} + +func TestGettersDocumentsCommit200Response(t *testing.T) { + t.Run("GetDocument", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected *string - obj.IdempotencyKey = expected + obj := &DocumentsCommit200Response{} + var expected *DocumentsCommit200ResponseDocument + obj.Document = expected // Act & Assert - assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") }) - t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { + t.Run("GetDocument_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - obj.IdempotencyKey = nil + obj := &DocumentsCommit200Response{} + obj.Document = nil // Act & Assert - assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") }) - t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { + t.Run("GetDocument_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsCommit200ResponseDocument + var obj *DocumentsCommit200Response // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIdempotencyKey() // Should return zero value + _ = obj.GetDocument() // Should return zero value }) - t.Run("GetFailureReason", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsCommit200ResponseDocument{} - var expected *string - obj.FailureReason = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") - }) +} - t.Run("GetFailureReason_NilValue", func(t *testing.T) { +func TestSettersMarkExplicitDocumentsCommit200Response(t *testing.T) { + t.Run("SetDocument_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsCommit200ResponseDocument{} - obj.FailureReason = nil + obj := &DocumentsCommit200Response{} + var fernTestValueDocument *DocumentsCommit200ResponseDocument + + // Act + obj.SetDocument(fernTestValueDocument) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsCommit200ResponseDocument(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTenantID", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetState", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueState DocumentsCommit200ResponseDocumentState + obj.SetState(fernTestValueState) + assert.Equal(t, fernTestValueState, obj.State) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBaseSha", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueBaseSha *string + obj.SetBaseSha(fernTestValueBaseSha) + assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStorageSizeBytes", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueStorageSizeBytes *float64 + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMetadata", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueMetadata map[string]any + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIdempotencyKey", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueIdempotencyKey *string + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFailureReason", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueFailureReason *string + obj.SetFailureReason(fernTestValueFailureReason) + assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetThumbnailState", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueThumbnailState *DocumentsCommit200ResponseDocumentThumbnailState + obj.SetThumbnailState(fernTestValueThumbnailState) + assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetThumbnailURL", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueThumbnailURL *string + obj.SetThumbnailURL(fernTestValueThumbnailURL) + assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueCreatedAt float64 + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueUpdatedAt float64 + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedBy", func(t *testing.T) { + obj := &DocumentsCommit200ResponseDocument{} + var fernTestValueCreatedBy *string + obj.SetCreatedBy(fernTestValueCreatedBy) + assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() var obj *DocumentsCommit200ResponseDocument // Should not panic - getters should handle nil receiver gracefully @@ -1407,31 +1514,44 @@ func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFailureReason() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetThumbnailState", func(t *testing.T) { + t.Run("GetTenantID", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} - var expected *DocumentsCommit200ResponseDocumentThumbnailState - obj.ThumbnailState = expected + var expected string + obj.TenantID = expected // Act & Assert - assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") }) - t.Run("GetThumbnailState_NilValue", func(t *testing.T) { + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTenantID() // Should return zero value + }) + + t.Run("GetState", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} - obj.ThumbnailState = nil + var expected DocumentsCommit200ResponseDocumentState + obj.State = expected // Act & Assert - assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetState(), "getter should return the property value") }) - t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Run("GetState_NilReceiver", func(t *testing.T) { t.Parallel() var obj *DocumentsCommit200ResponseDocument // Should not panic - getters should handle nil receiver gracefully @@ -1440,31 +1560,31 @@ func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetThumbnailState() // Should return zero value + _ = obj.GetState() // Should return zero value }) - t.Run("GetThumbnailURL", func(t *testing.T) { + t.Run("GetBaseSha", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} var expected *string - obj.ThumbnailURL = expected + obj.BaseSha = expected // Act & Assert - assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") }) - t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { + t.Run("GetBaseSha_NilValue", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} - obj.ThumbnailURL = nil + obj.BaseSha = nil // Act & Assert - assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") }) - t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { + t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { t.Parallel() var obj *DocumentsCommit200ResponseDocument // Should not panic - getters should handle nil receiver gracefully @@ -1473,21 +1593,31 @@ func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetThumbnailURL() // Should return zero value + _ = obj.GetBaseSha() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetStorageSizeBytes", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} - var expected float64 - obj.CreatedAt = expected + var expected *float64 + obj.StorageSizeBytes = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + obj.StorageSizeBytes = nil + + // Act & Assert + assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") + }) + + t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { t.Parallel() var obj *DocumentsCommit200ResponseDocument // Should not panic - getters should handle nil receiver gracefully @@ -1496,21 +1626,31 @@ func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetStorageSizeBytes() // Should return zero value }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetMetadata", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} - var expected float64 - obj.UpdatedAt = expected + var expected map[string]any + obj.Metadata = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + obj.Metadata = nil + + // Act & Assert + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + }) + + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { t.Parallel() var obj *DocumentsCommit200ResponseDocument // Should not panic - getters should handle nil receiver gracefully @@ -1519,31 +1659,31 @@ func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetMetadata() // Should return zero value }) - t.Run("GetCreatedBy", func(t *testing.T) { + t.Run("GetIdempotencyKey", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} var expected *string - obj.CreatedBy = expected + obj.IdempotencyKey = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") }) - t.Run("GetCreatedBy_NilValue", func(t *testing.T) { + t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsCommit200ResponseDocument{} - obj.CreatedBy = nil + obj.IdempotencyKey = nil // Act & Assert - assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") }) - t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { + t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { t.Parallel() var obj *DocumentsCommit200ResponseDocument // Should not panic - getters should handle nil receiver gracefully @@ -1552,10 +1692,188 @@ func TestGettersDocumentsCommit200ResponseDocument(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedBy() // Should return zero value + _ = obj.GetIdempotencyKey() // Should return zero value }) -} + t.Run("GetFailureReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + var expected *string + obj.FailureReason = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") + }) + + t.Run("GetFailureReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + obj.FailureReason = nil + + // Act & Assert + assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") + }) + + t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailureReason() // Should return zero value + }) + + t.Run("GetThumbnailState", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + var expected *DocumentsCommit200ResponseDocumentThumbnailState + obj.ThumbnailState = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") + }) + + t.Run("GetThumbnailState_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + obj.ThumbnailState = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailState() // Should return zero value + }) + + t.Run("GetThumbnailURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + var expected *string + obj.ThumbnailURL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") + }) + + t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + obj.ThumbnailURL = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailURL() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + var expected float64 + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + var expected float64 + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + + t.Run("GetCreatedBy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + var expected *string + obj.CreatedBy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") + }) + + t.Run("GetCreatedBy_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsCommit200ResponseDocument{} + obj.CreatedBy = nil + + // Act & Assert + assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") + }) + + t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedBy() // Should return zero value + }) + +} func TestSettersMarkExplicitDocumentsCommit200ResponseDocument(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { @@ -2939,12 +3257,31 @@ func TestSettersMarkExplicitDocumentsGet200ResponseDocument(t *testing.T) { } -func TestGettersDocumentsInit200Response(t *testing.T) { +func TestSettersDocumentsImportFrom200Response(t *testing.T) { + t.Run("SetTag", func(t *testing.T) { + obj := &DocumentsImportFrom200Response{} + var fernTestValueTag DocumentsImportFrom200ResponseTag + obj.SetTag(fernTestValueTag) + assert.Equal(t, fernTestValueTag, obj.Tag) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDocument", func(t *testing.T) { + obj := &DocumentsImportFrom200Response{} + var fernTestValueDocument *DocumentsImportFrom200ResponseDocument + obj.SetDocument(fernTestValueDocument) + assert.Equal(t, fernTestValueDocument, obj.Document) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom200Response(t *testing.T) { t.Run("GetTag", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200Response{} - var expected string + obj := &DocumentsImportFrom200Response{} + var expected DocumentsImportFrom200ResponseTag obj.Tag = expected // Act & Assert @@ -2953,7 +3290,7 @@ func TestGettersDocumentsInit200Response(t *testing.T) { t.Run("GetTag_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200Response + var obj *DocumentsImportFrom200Response // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -2963,235 +3300,81 @@ func TestGettersDocumentsInit200Response(t *testing.T) { _ = obj.GetTag() // Should return zero value }) - t.Run("GetCreated", func(t *testing.T) { + t.Run("GetDocument", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200Response{} - var expected *DocumentsInit200ResponseCreated - obj.Created = expected + obj := &DocumentsImportFrom200Response{} + var expected *DocumentsImportFrom200ResponseDocument + obj.Document = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreated(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") }) - t.Run("GetCreated_NilValue", func(t *testing.T) { + t.Run("GetDocument_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200Response{} - obj.Created = nil + obj := &DocumentsImportFrom200Response{} + obj.Document = nil // Act & Assert - assert.Nil(t, obj.GetCreated(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") }) - t.Run("GetCreated_NilReceiver", func(t *testing.T) { + t.Run("GetDocument_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200Response + var obj *DocumentsImportFrom200Response // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreated() // Should return zero value + _ = obj.GetDocument() // Should return zero value }) - t.Run("GetResumed", func(t *testing.T) { +} + +func TestSettersMarkExplicitDocumentsImportFrom200Response(t *testing.T) { + t.Run("SetTag_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200Response{} - var expected *DocumentsInit200ResponseResumed - obj.Resumed = expected + obj := &DocumentsImportFrom200Response{} + var fernTestValueTag DocumentsImportFrom200ResponseTag - // Act & Assert - assert.Equal(t, expected, obj.GetResumed(), "getter should return the property value") + // Act + obj.SetTag(fernTestValueTag) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetResumed_NilValue", func(t *testing.T) { + t.Run("SetDocument_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200Response{} - obj.Resumed = nil + obj := &DocumentsImportFrom200Response{} + var fernTestValueDocument *DocumentsImportFrom200ResponseDocument - // Act & Assert - assert.Nil(t, obj.GetResumed(), "getter should return nil when property is nil") - }) - - t.Run("GetResumed_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200Response - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetResumed() // Should return zero value - }) - - t.Run("GetDeduped", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200Response{} - var expected *DocumentsInit200ResponseDeduped - obj.Deduped = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDeduped(), "getter should return the property value") - }) - - t.Run("GetDeduped_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200Response{} - obj.Deduped = nil - - // Act & Assert - assert.Nil(t, obj.GetDeduped(), "getter should return nil when property is nil") - }) - - t.Run("GetDeduped_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200Response - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDeduped() // Should return zero value - }) - -} - -func TestSettersDocumentsInit200ResponseCreated(t *testing.T) { - t.Run("SetDocument", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreated{} - var fernTestValueDocument *DocumentsInit200ResponseCreatedDocument - obj.SetDocument(fernTestValueDocument) - assert.Equal(t, fernTestValueDocument, obj.Document) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUpload", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreated{} - var fernTestValueUpload *DocumentsInit200ResponseCreatedUpload - obj.SetUpload(fernTestValueUpload) - assert.Equal(t, fernTestValueUpload, obj.Upload) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDocumentsInit200ResponseCreated(t *testing.T) { - t.Run("GetDocument", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreated{} - var expected *DocumentsInit200ResponseCreatedDocument - obj.Document = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") - }) - - t.Run("GetDocument_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreated{} - obj.Document = nil - - // Act & Assert - assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") - }) - - t.Run("GetDocument_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseCreated - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDocument() // Should return zero value - }) - - t.Run("GetUpload", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreated{} - var expected *DocumentsInit200ResponseCreatedUpload - obj.Upload = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetUpload(), "getter should return the property value") - }) - - t.Run("GetUpload_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreated{} - obj.Upload = nil - - // Act & Assert - assert.Nil(t, obj.GetUpload(), "getter should return nil when property is nil") - }) - - t.Run("GetUpload_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseCreated - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUpload() // Should return zero value - }) - -} - -func TestSettersMarkExplicitDocumentsInit200ResponseCreated(t *testing.T) { - t.Run("SetDocument_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreated{} - var fernTestValueDocument *DocumentsInit200ResponseCreatedDocument - - // Act - obj.SetDocument(fernTestValueDocument) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - - t.Run("SetUpload_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreated{} - var fernTestValueUpload *DocumentsInit200ResponseCreatedUpload - - // Act - obj.SetUpload(fernTestValueUpload) + // Act + obj.SetDocument(fernTestValueDocument) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -3217,9 +3400,9 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreated(t *testing.T) { } -func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { +func TestSettersDocumentsImportFrom200ResponseDocument(t *testing.T) { t.Run("SetID", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueID string obj.SetID(fernTestValueID) assert.Equal(t, fernTestValueID, obj.ID) @@ -3227,7 +3410,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetTenantID", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueTenantID string obj.SetTenantID(fernTestValueTenantID) assert.Equal(t, fernTestValueTenantID, obj.TenantID) @@ -3235,15 +3418,15 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetState", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} - var fernTestValueState DocumentsInit200ResponseCreatedDocumentState + obj := &DocumentsImportFrom200ResponseDocument{} + var fernTestValueState DocumentsImportFrom200ResponseDocumentState obj.SetState(fernTestValueState) assert.Equal(t, fernTestValueState, obj.State) assert.NotNil(t, obj.explicitFields) }) t.Run("SetBaseSha", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueBaseSha *string obj.SetBaseSha(fernTestValueBaseSha) assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) @@ -3251,7 +3434,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetStorageSizeBytes", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueStorageSizeBytes *float64 obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) @@ -3259,7 +3442,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetMetadata", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueMetadata map[string]any obj.SetMetadata(fernTestValueMetadata) assert.Equal(t, fernTestValueMetadata, obj.Metadata) @@ -3267,7 +3450,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetIdempotencyKey", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueIdempotencyKey *string obj.SetIdempotencyKey(fernTestValueIdempotencyKey) assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) @@ -3275,7 +3458,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetFailureReason", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueFailureReason *string obj.SetFailureReason(fernTestValueFailureReason) assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) @@ -3283,15 +3466,15 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetThumbnailState", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} - var fernTestValueThumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState + obj := &DocumentsImportFrom200ResponseDocument{} + var fernTestValueThumbnailState *DocumentsImportFrom200ResponseDocumentThumbnailState obj.SetThumbnailState(fernTestValueThumbnailState) assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) assert.NotNil(t, obj.explicitFields) }) t.Run("SetThumbnailURL", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueThumbnailURL *string obj.SetThumbnailURL(fernTestValueThumbnailURL) assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) @@ -3299,7 +3482,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetCreatedAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueCreatedAt float64 obj.SetCreatedAt(fernTestValueCreatedAt) assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) @@ -3307,7 +3490,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueUpdatedAt float64 obj.SetUpdatedAt(fernTestValueUpdatedAt) assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) @@ -3315,7 +3498,7 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { }) t.Run("SetCreatedBy", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueCreatedBy *string obj.SetCreatedBy(fernTestValueCreatedBy) assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) @@ -3324,11 +3507,11 @@ func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { } -func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { +func TestGettersDocumentsImportFrom200ResponseDocument(t *testing.T) { t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected string obj.ID = expected @@ -3338,7 +3521,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3351,7 +3534,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetTenantID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected string obj.TenantID = expected @@ -3361,7 +3544,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetTenantID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3374,8 +3557,8 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} - var expected DocumentsInit200ResponseCreatedDocumentState + obj := &DocumentsImportFrom200ResponseDocument{} + var expected DocumentsImportFrom200ResponseDocumentState obj.State = expected // Act & Assert @@ -3384,7 +3567,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetState_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3397,7 +3580,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetBaseSha", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected *string obj.BaseSha = expected @@ -3408,7 +3591,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetBaseSha_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.BaseSha = nil // Act & Assert @@ -3417,7 +3600,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3430,7 +3613,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetStorageSizeBytes", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected *float64 obj.StorageSizeBytes = expected @@ -3441,7 +3624,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.StorageSizeBytes = nil // Act & Assert @@ -3450,7 +3633,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3463,7 +3646,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetMetadata", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected map[string]any obj.Metadata = expected @@ -3474,7 +3657,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetMetadata_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.Metadata = nil // Act & Assert @@ -3483,7 +3666,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetMetadata_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3496,7 +3679,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetIdempotencyKey", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected *string obj.IdempotencyKey = expected @@ -3507,7 +3690,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.IdempotencyKey = nil // Act & Assert @@ -3516,7 +3699,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3529,7 +3712,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetFailureReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected *string obj.FailureReason = expected @@ -3540,7 +3723,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetFailureReason_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.FailureReason = nil // Act & Assert @@ -3549,7 +3732,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3562,8 +3745,8 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetThumbnailState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} - var expected *DocumentsInit200ResponseCreatedDocumentThumbnailState + obj := &DocumentsImportFrom200ResponseDocument{} + var expected *DocumentsImportFrom200ResponseDocumentThumbnailState obj.ThumbnailState = expected // Act & Assert @@ -3573,7 +3756,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetThumbnailState_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.ThumbnailState = nil // Act & Assert @@ -3582,7 +3765,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3595,7 +3778,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetThumbnailURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected *string obj.ThumbnailURL = expected @@ -3606,7 +3789,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.ThumbnailURL = nil // Act & Assert @@ -3615,7 +3798,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3628,7 +3811,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected float64 obj.CreatedAt = expected @@ -3638,7 +3821,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3651,7 +3834,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected float64 obj.UpdatedAt = expected @@ -3661,7 +3844,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3674,7 +3857,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetCreatedBy", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var expected *string obj.CreatedBy = expected @@ -3685,7 +3868,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetCreatedBy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} obj.CreatedBy = nil // Act & Assert @@ -3694,7 +3877,7 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedDocument + var obj *DocumentsImportFrom200ResponseDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -3706,11 +3889,11 @@ func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { } -func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T) { +func TestSettersMarkExplicitDocumentsImportFrom200ResponseDocument(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueID string // Act @@ -3741,7 +3924,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueTenantID string // Act @@ -3772,8 +3955,8 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetState_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} - var fernTestValueState DocumentsInit200ResponseCreatedDocumentState + obj := &DocumentsImportFrom200ResponseDocument{} + var fernTestValueState DocumentsImportFrom200ResponseDocumentState // Act obj.SetState(fernTestValueState) @@ -3803,7 +3986,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueBaseSha *string // Act @@ -3834,7 +4017,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueStorageSizeBytes *float64 // Act @@ -3865,7 +4048,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueMetadata map[string]any // Act @@ -3896,7 +4079,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueIdempotencyKey *string // Act @@ -3927,7 +4110,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueFailureReason *string // Act @@ -3958,8 +4141,8 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} - var fernTestValueThumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState + obj := &DocumentsImportFrom200ResponseDocument{} + var fernTestValueThumbnailState *DocumentsImportFrom200ResponseDocumentThumbnailState // Act obj.SetThumbnailState(fernTestValueThumbnailState) @@ -3989,7 +4172,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueThumbnailURL *string // Act @@ -4020,7 +4203,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueCreatedAt float64 // Act @@ -4051,7 +4234,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueUpdatedAt float64 // Act @@ -4082,7 +4265,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedDocument{} + obj := &DocumentsImportFrom200ResponseDocument{} var fernTestValueCreatedBy *string // Act @@ -4112,185 +4295,228 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T } -func TestGettersDocumentsInit200ResponseCreatedUpload(t *testing.T) { - t.Run("GetKind", func(t *testing.T) { +func TestGettersDocumentsInit200Response(t *testing.T) { + t.Run("GetTag", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUpload{} + obj := &DocumentsInit200Response{} var expected string - obj.Kind = expected + obj.Tag = expected // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTag(), "getter should return the property value") }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Run("GetTag_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUpload + var obj *DocumentsInit200Response // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKind() // Should return zero value + _ = obj.GetTag() // Should return zero value }) - t.Run("GetPresigned", func(t *testing.T) { + t.Run("GetCreated", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUpload{} - var expected *DocumentsInit200ResponseCreatedUploadPresigned - obj.Presigned = expected + obj := &DocumentsInit200Response{} + var expected *DocumentsInit200ResponseCreated + obj.Created = expected // Act & Assert - assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreated(), "getter should return the property value") }) - t.Run("GetPresigned_NilValue", func(t *testing.T) { + t.Run("GetCreated_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUpload{} - obj.Presigned = nil + obj := &DocumentsInit200Response{} + obj.Created = nil // Act & Assert - assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCreated(), "getter should return nil when property is nil") }) - t.Run("GetPresigned_NilReceiver", func(t *testing.T) { + t.Run("GetCreated_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUpload + var obj *DocumentsInit200Response // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPresigned() // Should return zero value + _ = obj.GetCreated() // Should return zero value }) - t.Run("GetProxy", func(t *testing.T) { + t.Run("GetResumed", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUpload{} - var expected *DocumentsInit200ResponseCreatedUploadProxy - obj.Proxy = expected + obj := &DocumentsInit200Response{} + var expected *DocumentsInit200ResponseResumed + obj.Resumed = expected // Act & Assert - assert.Equal(t, expected, obj.GetProxy(), "getter should return the property value") + assert.Equal(t, expected, obj.GetResumed(), "getter should return the property value") }) - t.Run("GetProxy_NilValue", func(t *testing.T) { + t.Run("GetResumed_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUpload{} - obj.Proxy = nil + obj := &DocumentsInit200Response{} + obj.Resumed = nil // Act & Assert - assert.Nil(t, obj.GetProxy(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetResumed(), "getter should return nil when property is nil") }) - t.Run("GetProxy_NilReceiver", func(t *testing.T) { + t.Run("GetResumed_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUpload + var obj *DocumentsInit200Response // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetProxy() // Should return zero value + _ = obj.GetResumed() // Should return zero value + }) + + t.Run("GetDeduped", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200Response{} + var expected *DocumentsInit200ResponseDeduped + obj.Deduped = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDeduped(), "getter should return the property value") + }) + + t.Run("GetDeduped_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200Response{} + obj.Deduped = nil + + // Act & Assert + assert.Nil(t, obj.GetDeduped(), "getter should return nil when property is nil") + }) + + t.Run("GetDeduped_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDeduped() // Should return zero value }) } -func TestSettersDocumentsInit200ResponseCreatedUploadPresigned(t *testing.T) { - t.Run("SetPresigned", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadPresigned{} - var fernTestValuePresigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned - obj.SetPresigned(fernTestValuePresigned) - assert.Equal(t, fernTestValuePresigned, obj.Presigned) +func TestSettersDocumentsInit200ResponseCreated(t *testing.T) { + t.Run("SetDocument", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreated{} + var fernTestValueDocument *DocumentsInit200ResponseCreatedDocument + obj.SetDocument(fernTestValueDocument) + assert.Equal(t, fernTestValueDocument, obj.Document) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetKey", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadPresigned{} - var fernTestValueKey string - obj.SetKey(fernTestValueKey) - assert.Equal(t, fernTestValueKey, obj.Key) + t.Run("SetUpload", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreated{} + var fernTestValueUpload *DocumentsInit200ResponseCreatedUpload + obj.SetUpload(fernTestValueUpload) + assert.Equal(t, fernTestValueUpload, obj.Upload) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDocumentsInit200ResponseCreatedUploadPresigned(t *testing.T) { - t.Run("GetPresigned", func(t *testing.T) { +func TestGettersDocumentsInit200ResponseCreated(t *testing.T) { + t.Run("GetDocument", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresigned{} - var expected *DocumentsInit200ResponseCreatedUploadPresignedPresigned - obj.Presigned = expected + obj := &DocumentsInit200ResponseCreated{} + var expected *DocumentsInit200ResponseCreatedDocument + obj.Document = expected // Act & Assert - assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") }) - t.Run("GetPresigned_NilValue", func(t *testing.T) { + t.Run("GetDocument_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresigned{} - obj.Presigned = nil + obj := &DocumentsInit200ResponseCreated{} + obj.Document = nil // Act & Assert - assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") }) - t.Run("GetPresigned_NilReceiver", func(t *testing.T) { + t.Run("GetDocument_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadPresigned + var obj *DocumentsInit200ResponseCreated // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPresigned() // Should return zero value + _ = obj.GetDocument() // Should return zero value }) - t.Run("GetKey", func(t *testing.T) { + t.Run("GetUpload", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresigned{} - var expected string - obj.Key = expected + obj := &DocumentsInit200ResponseCreated{} + var expected *DocumentsInit200ResponseCreatedUpload + obj.Upload = expected // Act & Assert - assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUpload(), "getter should return the property value") }) - t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Run("GetUpload_NilValue", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadPresigned + // Arrange + obj := &DocumentsInit200ResponseCreated{} + obj.Upload = nil + + // Act & Assert + assert.Nil(t, obj.GetUpload(), "getter should return nil when property is nil") + }) + + t.Run("GetUpload_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreated // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKey() // Should return zero value + _ = obj.GetUpload() // Should return zero value }) } -func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadPresigned(t *testing.T) { - t.Run("SetPresigned_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDocumentsInit200ResponseCreated(t *testing.T) { + t.Run("SetDocument_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresigned{} - var fernTestValuePresigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned + obj := &DocumentsInit200ResponseCreated{} + var fernTestValueDocument *DocumentsInit200ResponseCreatedDocument // Act - obj.SetPresigned(fernTestValuePresigned) + obj.SetDocument(fernTestValueDocument) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -4314,14 +4540,14 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadPresigned(t *te // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Run("SetUpload_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresigned{} - var fernTestValueKey string + obj := &DocumentsInit200ResponseCreated{} + var fernTestValueUpload *DocumentsInit200ResponseCreatedUpload // Act - obj.SetKey(fernTestValueKey) + obj.SetUpload(fernTestValueUpload) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -4347,350 +4573,504 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadPresigned(t *te } -func TestSettersDocumentsInit200ResponseCreatedUploadPresignedPresigned(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) +func TestSettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHeaders", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueHeaders map[string]string - obj.SetHeaders(fernTestValueHeaders) - assert.Equal(t, fernTestValueHeaders, obj.Headers) + t.Run("SetTenantID", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMethod", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueMethod DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod - obj.SetMethod(fernTestValueMethod) - assert.Equal(t, fernTestValueMethod, obj.Method) + t.Run("SetState", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueState DocumentsInit200ResponseCreatedDocumentState + obj.SetState(fernTestValueState) + assert.Equal(t, fernTestValueState, obj.State) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetExpiresAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueExpiresAt float64 - obj.SetExpiresAt(fernTestValueExpiresAt) - assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + t.Run("SetBaseSha", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueBaseSha *string + obj.SetBaseSha(fernTestValueBaseSha) + assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) assert.NotNil(t, obj.explicitFields) }) -} - -func TestGettersDocumentsInit200ResponseCreatedUploadPresignedPresigned(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var expected string - obj.URL = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + t.Run("SetStorageSizeBytes", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueStorageSizeBytes *float64 + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value + t.Run("SetMetadata", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueMetadata map[string]any + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetHeaders", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var expected map[string]string - obj.Headers = expected + t.Run("SetIdempotencyKey", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueIdempotencyKey *string + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") + t.Run("SetFailureReason", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueFailureReason *string + obj.SetFailureReason(fernTestValueFailureReason) + assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetHeaders_NilValue", func(t *testing.T) { + t.Run("SetThumbnailState", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueThumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState + obj.SetThumbnailState(fernTestValueThumbnailState) + assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetThumbnailURL", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueThumbnailURL *string + obj.SetThumbnailURL(fernTestValueThumbnailURL) + assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueCreatedAt float64 + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueUpdatedAt float64 + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedBy", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueCreatedBy *string + obj.SetCreatedBy(fernTestValueCreatedBy) + assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseCreatedDocument(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - obj.Headers = nil + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetHeaders_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned + var obj *DocumentsInit200ResponseCreatedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHeaders() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetMethod", func(t *testing.T) { + t.Run("GetTenantID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var expected DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod - obj.Method = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected string + obj.TenantID = expected // Act & Assert - assert.Equal(t, expected, obj.GetMethod(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") }) - t.Run("GetMethod_NilReceiver", func(t *testing.T) { + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned + var obj *DocumentsInit200ResponseCreatedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMethod() // Should return zero value + _ = obj.GetTenantID() // Should return zero value }) - t.Run("GetExpiresAt", func(t *testing.T) { + t.Run("GetState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var expected float64 - obj.ExpiresAt = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected DocumentsInit200ResponseCreatedDocumentState + obj.State = expected // Act & Assert - assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetState(), "getter should return the property value") }) - t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { + t.Run("GetState_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned + var obj *DocumentsInit200ResponseCreatedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetExpiresAt() // Should return zero value + _ = obj.GetState() // Should return zero value }) -} - -func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadPresignedPresigned(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("GetBaseSha", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueURL string + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected *string + obj.BaseSha = expected - // Act - obj.SetURL(fernTestValueURL) + // Act & Assert + assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetBaseSha_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.BaseSha = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBaseSha() // Should return zero value }) - t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { + t.Run("GetStorageSizeBytes", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueHeaders map[string]string + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected *float64 + obj.StorageSizeBytes = expected - // Act - obj.SetHeaders(fernTestValueHeaders) + // Act & Assert + assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.StorageSizeBytes = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStorageSizeBytes() // Should return zero value }) - t.Run("SetMethod_MarksExplicit", func(t *testing.T) { + t.Run("GetMetadata", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueMethod DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected map[string]any + obj.Metadata = expected - // Act - obj.SetMethod(fernTestValueMethod) + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.Metadata = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMetadata() // Should return zero value }) - t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("GetIdempotencyKey", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} - var fernTestValueExpiresAt float64 + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected *string + obj.IdempotencyKey = expected - // Act - obj.SetExpiresAt(fernTestValueExpiresAt) + // Act & Assert + assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.IdempotencyKey = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIdempotencyKey() // Should return zero value }) -} + t.Run("GetFailureReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected *string + obj.FailureReason = expected -func TestSettersDocumentsInit200ResponseCreatedUploadProxy(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadProxy{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") }) - t.Run("SetKey", func(t *testing.T) { - obj := &DocumentsInit200ResponseCreatedUploadProxy{} - var fernTestValueKey string - obj.SetKey(fernTestValueKey) - assert.Equal(t, fernTestValueKey, obj.Key) - assert.NotNil(t, obj.explicitFields) + t.Run("GetFailureReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.FailureReason = nil + + // Act & Assert + assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") }) -} + t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailureReason() // Should return zero value + }) -func TestGettersDocumentsInit200ResponseCreatedUploadProxy(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { + t.Run("GetThumbnailState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadProxy{} - var expected string - obj.URL = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected *DocumentsInit200ResponseCreatedDocumentThumbnailState + obj.ThumbnailState = expected // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") }) - t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Run("GetThumbnailState_NilValue", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadProxy + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.ThumbnailState = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetURL() // Should return zero value + _ = obj.GetThumbnailState() // Should return zero value }) - t.Run("GetKey", func(t *testing.T) { + t.Run("GetThumbnailURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadProxy{} - var expected string - obj.Key = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected *string + obj.ThumbnailURL = expected // Act & Assert - assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") }) - t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseCreatedUploadProxy + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.ThumbnailURL = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKey() // Should return zero value + _ = obj.GetThumbnailURL() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected float64 + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected float64 + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + + t.Run("GetCreatedBy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var expected *string + obj.CreatedBy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") + }) + + t.Run("GetCreatedBy_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + obj.CreatedBy = nil + + // Act & Assert + assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") + }) + + t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedBy() // Should return zero value }) } -func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadProxy(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDocumentsInit200ResponseCreatedDocument(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadProxy{} - var fernTestValueURL string + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueID string // Act - obj.SetURL(fernTestValueURL) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -4714,14 +5094,14 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadProxy(t *testin // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseCreatedUploadProxy{} - var fernTestValueKey string + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueTenantID string // Act - obj.SetKey(fernTestValueKey) + obj.SetTenantID(fernTestValueTenantID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -4745,64 +5125,45 @@ func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadProxy(t *testin // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDocumentsInit200ResponseDeduped(t *testing.T) { - t.Run("SetDocument", func(t *testing.T) { - obj := &DocumentsInit200ResponseDeduped{} - var fernTestValueDocument *DocumentsInit200ResponseDedupedDocument - obj.SetDocument(fernTestValueDocument) - assert.Equal(t, fernTestValueDocument, obj.Document) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDocumentsInit200ResponseDeduped(t *testing.T) { - t.Run("GetDocument", func(t *testing.T) { + t.Run("SetState_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDeduped{} - var expected *DocumentsInit200ResponseDedupedDocument - obj.Document = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueState DocumentsInit200ResponseCreatedDocumentState - // Act & Assert - assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") - }) + // Act + obj.SetState(fernTestValueState) - t.Run("GetDocument_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseDeduped{} - obj.Document = nil + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - // Act & Assert - assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetDocument_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseDeduped - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetDocument() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersMarkExplicitDocumentsInit200ResponseDeduped(t *testing.T) { - t.Run("SetDocument_MarksExplicit", func(t *testing.T) { + t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDeduped{} - var fernTestValueDocument *DocumentsInit200ResponseDedupedDocument + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueBaseSha *string // Act - obj.SetDocument(fernTestValueDocument) + obj.SetBaseSha(fernTestValueBaseSha) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -4826,506 +5187,671 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDeduped(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} - -func TestSettersDocumentsInit200ResponseDedupedDocument(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueStorageSizeBytes *float64 - t.Run("SetTenantID", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueTenantID string - obj.SetTenantID(fernTestValueTenantID) - assert.Equal(t, fernTestValueTenantID, obj.TenantID) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) - t.Run("SetState", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueState DocumentsInit200ResponseDedupedDocumentState - obj.SetState(fernTestValueState) - assert.Equal(t, fernTestValueState, obj.State) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetBaseSha", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueBaseSha *string - obj.SetBaseSha(fernTestValueBaseSha) - assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetStorageSizeBytes", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueStorageSizeBytes *float64 - obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) - assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMetadata", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} var fernTestValueMetadata map[string]any + + // Act obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) - assert.NotNil(t, obj.explicitFields) - }) - t.Run("SetIdempotencyKey", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueIdempotencyKey *string - obj.SetIdempotencyKey(fernTestValueIdempotencyKey) - assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetFailureReason", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueFailureReason *string - obj.SetFailureReason(fernTestValueFailureReason) - assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("SetThumbnailState", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueThumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState - obj.SetThumbnailState(fernTestValueThumbnailState) - assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) - assert.NotNil(t, obj.explicitFields) + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetThumbnailURL", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueThumbnailURL *string - obj.SetThumbnailURL(fernTestValueThumbnailURL) - assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueIdempotencyKey *string - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueCreatedAt float64 - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueUpdatedAt float64 - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetCreatedBy", func(t *testing.T) { - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueCreatedBy *string - obj.SetCreatedBy(fernTestValueCreatedBy) - assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) - assert.NotNil(t, obj.explicitFields) - }) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -} + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) -func TestGettersDocumentsInit200ResponseDedupedDocument(t *testing.T) { - t.Run("GetID", func(t *testing.T) { + t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected string - obj.ID = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueFailureReason *string - // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + // Act + obj.SetFailureReason(fernTestValueFailureReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetID() // Should return zero value + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueThumbnailState *DocumentsInit200ResponseCreatedDocumentThumbnailState + + // Act + obj.SetThumbnailState(fernTestValueThumbnailState) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetTenantID", func(t *testing.T) { + t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected string - obj.TenantID = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueThumbnailURL *string - // Act & Assert - assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") - }) + // Act + obj.SetThumbnailURL(fernTestValueThumbnailURL) - t.Run("GetTenantID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTenantID() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetState", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected DocumentsInit200ResponseDedupedDocumentState - obj.State = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueCreatedAt float64 - // Act & Assert - assert.Equal(t, expected, obj.GetState(), "getter should return the property value") + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetState_NilReceiver", func(t *testing.T) { + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetState() // Should return zero value + // Arrange + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueUpdatedAt float64 + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetBaseSha", func(t *testing.T) { + t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected *string - obj.BaseSha = expected + obj := &DocumentsInit200ResponseCreatedDocument{} + var fernTestValueCreatedBy *string - // Act & Assert - assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") + // Act + obj.SetCreatedBy(fernTestValueCreatedBy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetBaseSha_NilValue", func(t *testing.T) { +} + +func TestGettersDocumentsInit200ResponseCreatedUpload(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.BaseSha = nil + obj := &DocumentsInit200ResponseCreatedUpload{} + var expected string + obj.Kind = expected // Act & Assert - assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") }) - t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { + t.Run("GetKind_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUpload // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBaseSha() // Should return zero value + _ = obj.GetKind() // Should return zero value }) - t.Run("GetStorageSizeBytes", func(t *testing.T) { + t.Run("GetPresigned", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected *float64 - obj.StorageSizeBytes = expected + obj := &DocumentsInit200ResponseCreatedUpload{} + var expected *DocumentsInit200ResponseCreatedUploadPresigned + obj.Presigned = expected // Act & Assert - assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") + assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") }) - t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { + t.Run("GetPresigned_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.StorageSizeBytes = nil + obj := &DocumentsInit200ResponseCreatedUpload{} + obj.Presigned = nil // Act & Assert - assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") }) - t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { + t.Run("GetPresigned_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUpload // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetStorageSizeBytes() // Should return zero value + _ = obj.GetPresigned() // Should return zero value }) - t.Run("GetMetadata", func(t *testing.T) { + t.Run("GetProxy", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected map[string]any - obj.Metadata = expected + obj := &DocumentsInit200ResponseCreatedUpload{} + var expected *DocumentsInit200ResponseCreatedUploadProxy + obj.Proxy = expected // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + assert.Equal(t, expected, obj.GetProxy(), "getter should return the property value") }) - t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Run("GetProxy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.Metadata = nil + obj := &DocumentsInit200ResponseCreatedUpload{} + obj.Proxy = nil // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetProxy(), "getter should return nil when property is nil") }) - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Run("GetProxy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUpload // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMetadata() // Should return zero value + _ = obj.GetProxy() // Should return zero value }) - t.Run("GetIdempotencyKey", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected *string - obj.IdempotencyKey = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") - }) +} - t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { - t.Parallel() +func TestSettersDocumentsInit200ResponseCreatedUploadPresigned(t *testing.T) { + t.Run("SetPresigned", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadPresigned{} + var fernTestValuePresigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned + obj.SetPresigned(fernTestValuePresigned) + assert.Equal(t, fernTestValuePresigned, obj.Presigned) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKey", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadPresigned{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseCreatedUploadPresigned(t *testing.T) { + t.Run("GetPresigned", func(t *testing.T) { + t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.IdempotencyKey = nil + obj := &DocumentsInit200ResponseCreatedUploadPresigned{} + var expected *DocumentsInit200ResponseCreatedUploadPresignedPresigned + obj.Presigned = expected // Act & Assert - assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") }) - t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { + t.Run("GetPresigned_NilValue", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + // Arrange + obj := &DocumentsInit200ResponseCreatedUploadPresigned{} + obj.Presigned = nil + + // Act & Assert + assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") + }) + + t.Run("GetPresigned_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedUploadPresigned // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIdempotencyKey() // Should return zero value - }) - - t.Run("GetFailureReason", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected *string - obj.FailureReason = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") + _ = obj.GetPresigned() // Should return zero value }) - t.Run("GetFailureReason_NilValue", func(t *testing.T) { + t.Run("GetKey", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.FailureReason = nil + obj := &DocumentsInit200ResponseCreatedUploadPresigned{} + var expected string + obj.Key = expected // Act & Assert - assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") }) - t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Run("GetKey_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUploadPresigned // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetFailureReason() // Should return zero value + _ = obj.GetKey() // Should return zero value }) - t.Run("GetThumbnailState", func(t *testing.T) { +} + +func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadPresigned(t *testing.T) { + t.Run("SetPresigned_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected *DocumentsInit200ResponseDedupedDocumentThumbnailState - obj.ThumbnailState = expected + obj := &DocumentsInit200ResponseCreatedUploadPresigned{} + var fernTestValuePresigned *DocumentsInit200ResponseCreatedUploadPresignedPresigned - // Act & Assert - assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") + // Act + obj.SetPresigned(fernTestValuePresigned) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetThumbnailState_NilValue", func(t *testing.T) { + t.Run("SetKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.ThumbnailState = nil + obj := &DocumentsInit200ResponseCreatedUploadPresigned{} + var fernTestValueKey string + + // Act + obj.SetKey(fernTestValueKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsInit200ResponseCreatedUploadPresignedPresigned(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHeaders", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueHeaders map[string]string + obj.SetHeaders(fernTestValueHeaders) + assert.Equal(t, fernTestValueHeaders, obj.Headers) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMethod", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueMethod DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod + obj.SetMethod(fernTestValueMethod) + assert.Equal(t, fernTestValueMethod, obj.Method) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExpiresAt", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueExpiresAt float64 + obj.SetExpiresAt(fernTestValueExpiresAt) + assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseCreatedUploadPresignedPresigned(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var expected string + obj.URL = expected // Act & Assert - assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetThumbnailState() // Should return zero value + _ = obj.GetURL() // Should return zero value }) - t.Run("GetThumbnailURL", func(t *testing.T) { + t.Run("GetHeaders", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected *string - obj.ThumbnailURL = expected + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var expected map[string]string + obj.Headers = expected // Act & Assert - assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") + assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") }) - t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { + t.Run("GetHeaders_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.ThumbnailURL = nil + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + obj.Headers = nil // Act & Assert - assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") }) - t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { + t.Run("GetHeaders_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetThumbnailURL() // Should return zero value + _ = obj.GetHeaders() // Should return zero value }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("GetMethod", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected float64 - obj.CreatedAt = expected + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var expected DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod + obj.Method = expected // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetMethod(), "getter should return the property value") }) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetCreatedAt() // Should return zero value + _ = obj.GetMethod() // Should return zero value }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("GetExpiresAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} var expected float64 - obj.UpdatedAt = expected + obj.ExpiresAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") }) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument + var obj *DocumentsInit200ResponseCreatedUploadPresignedPresigned // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpdatedAt() // Should return zero value + _ = obj.GetExpiresAt() // Should return zero value }) - t.Run("GetCreatedBy", func(t *testing.T) { +} + +func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadPresignedPresigned(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var expected *string - obj.CreatedBy = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") - }) - - t.Run("GetCreatedBy_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - obj.CreatedBy = nil - - // Act & Assert - assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") - }) - - t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseDedupedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedBy() // Should return zero value - }) - -} - -func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueID string + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueURL string // Act - obj.SetID(fernTestValueID) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -5349,14 +5875,14 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueTenantID string + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueHeaders map[string]string // Act - obj.SetTenantID(fernTestValueTenantID) + obj.SetHeaders(fernTestValueHeaders) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -5380,14 +5906,14 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetState_MarksExplicit", func(t *testing.T) { + t.Run("SetMethod_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueState DocumentsInit200ResponseDedupedDocumentState + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueMethod DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod // Act - obj.SetState(fernTestValueState) + obj.SetMethod(fernTestValueMethod) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -5411,14 +5937,14 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { + t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueBaseSha *string + obj := &DocumentsInit200ResponseCreatedUploadPresignedPresigned{} + var fernTestValueExpiresAt float64 // Act - obj.SetBaseSha(fernTestValueBaseSha) + obj.SetExpiresAt(fernTestValueExpiresAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -5442,45 +5968,85 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { +} + +func TestSettersDocumentsInit200ResponseCreatedUploadProxy(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadProxy{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKey", func(t *testing.T) { + obj := &DocumentsInit200ResponseCreatedUploadProxy{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseCreatedUploadProxy(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueStorageSizeBytes *float64 + obj := &DocumentsInit200ResponseCreatedUploadProxy{} + var expected string + obj.URL = expected - // Act - obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedUploadProxy + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetKey", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseCreatedUploadProxy{} + var expected string + obj.Key = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseCreatedUploadProxy + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKey() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsInit200ResponseCreatedUploadProxy(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueMetadata map[string]any + obj := &DocumentsInit200ResponseCreatedUploadProxy{} + var fernTestValueURL string // Act - obj.SetMetadata(fernTestValueMetadata) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -5504,14 +6070,14 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { + t.Run("SetKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueIdempotencyKey *string + obj := &DocumentsInit200ResponseCreatedUploadProxy{} + var fernTestValueKey string // Act - obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + obj.SetKey(fernTestValueKey) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -5535,45 +6101,64 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { +} + +func TestSettersDocumentsInit200ResponseDeduped(t *testing.T) { + t.Run("SetDocument", func(t *testing.T) { + obj := &DocumentsInit200ResponseDeduped{} + var fernTestValueDocument *DocumentsInit200ResponseDedupedDocument + obj.SetDocument(fernTestValueDocument) + assert.Equal(t, fernTestValueDocument, obj.Document) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseDeduped(t *testing.T) { + t.Run("GetDocument", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueFailureReason *string + obj := &DocumentsInit200ResponseDeduped{} + var expected *DocumentsInit200ResponseDedupedDocument + obj.Document = expected - // Act - obj.SetFailureReason(fernTestValueFailureReason) + // Act & Assert + assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetDocument_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseDeduped{} + obj.Document = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetDocument_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseDeduped + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDocument() // Should return zero value }) - t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitDocumentsInit200ResponseDeduped(t *testing.T) { + t.Run("SetDocument_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueThumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState + obj := &DocumentsInit200ResponseDeduped{} + var fernTestValueDocument *DocumentsInit200ResponseDedupedDocument // Act - obj.SetThumbnailState(fernTestValueThumbnailState) + obj.SetDocument(fernTestValueDocument) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -5597,598 +6182,321 @@ func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange +} + +func TestSettersDocumentsInit200ResponseDedupedDocument(t *testing.T) { + t.Run("SetID", func(t *testing.T) { obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueThumbnailURL *string + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetThumbnailURL(fernTestValueThumbnailURL) + t.Run("SetTenantID", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetState", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueState DocumentsInit200ResponseDedupedDocumentState + obj.SetState(fernTestValueState) + assert.Equal(t, fernTestValueState, obj.State) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetBaseSha", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueBaseSha *string + obj.SetBaseSha(fernTestValueBaseSha) + assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetStorageSizeBytes", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueStorageSizeBytes *float64 + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange + t.Run("SetMetadata", func(t *testing.T) { obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueCreatedAt float64 + var fernTestValueMetadata map[string]any + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) - // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + t.Run("SetIdempotencyKey", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueIdempotencyKey *string + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + assert.NotNil(t, obj.explicitFields) + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("SetFailureReason", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueFailureReason *string + obj.SetFailureReason(fernTestValueFailureReason) + assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) + assert.NotNil(t, obj.explicitFields) + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("SetThumbnailState", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueThumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState + obj.SetThumbnailState(fernTestValueThumbnailState) + assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) + assert.NotNil(t, obj.explicitFields) + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("SetThumbnailURL", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueThumbnailURL *string + obj.SetThumbnailURL(fernTestValueThumbnailURL) + assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange + t.Run("SetCreatedAt", func(t *testing.T) { obj := &DocumentsInit200ResponseDedupedDocument{} - var fernTestValueUpdatedAt float64 + var fernTestValueCreatedAt float64 + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) - // Act + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueUpdatedAt float64 obj.SetUpdatedAt(fernTestValueUpdatedAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange + t.Run("SetCreatedBy", func(t *testing.T) { obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueCreatedBy *string - - // Act obj.SetCreatedBy(fernTestValueCreatedBy) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) + assert.NotNil(t, obj.explicitFields) }) } -func TestSettersDocumentsInit200ResponseResumed(t *testing.T) { - t.Run("SetDocument", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumed{} - var fernTestValueDocument *DocumentsInit200ResponseResumedDocument - obj.SetDocument(fernTestValueDocument) - assert.Equal(t, fernTestValueDocument, obj.Document) - assert.NotNil(t, obj.explicitFields) - }) +func TestGettersDocumentsInit200ResponseDedupedDocument(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseDedupedDocument{} + var expected string + obj.ID = expected - t.Run("SetUpload", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumed{} - var fernTestValueUpload *DocumentsInit200ResponseResumedUpload - obj.SetUpload(fernTestValueUpload) - assert.Equal(t, fernTestValueUpload, obj.Upload) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) -} + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseDedupedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) -func TestGettersDocumentsInit200ResponseResumed(t *testing.T) { - t.Run("GetDocument", func(t *testing.T) { + t.Run("GetTenantID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumed{} - var expected *DocumentsInit200ResponseResumedDocument - obj.Document = expected + obj := &DocumentsInit200ResponseDedupedDocument{} + var expected string + obj.TenantID = expected // Act & Assert - assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") }) - t.Run("GetDocument_NilValue", func(t *testing.T) { + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseDedupedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTenantID() // Should return zero value + }) + + t.Run("GetState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumed{} - obj.Document = nil + obj := &DocumentsInit200ResponseDedupedDocument{} + var expected DocumentsInit200ResponseDedupedDocumentState + obj.State = expected // Act & Assert - assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetState(), "getter should return the property value") }) - t.Run("GetDocument_NilReceiver", func(t *testing.T) { + t.Run("GetState_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumed + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDocument() // Should return zero value + _ = obj.GetState() // Should return zero value }) - t.Run("GetUpload", func(t *testing.T) { + t.Run("GetBaseSha", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumed{} - var expected *DocumentsInit200ResponseResumedUpload - obj.Upload = expected + obj := &DocumentsInit200ResponseDedupedDocument{} + var expected *string + obj.BaseSha = expected // Act & Assert - assert.Equal(t, expected, obj.GetUpload(), "getter should return the property value") + assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") }) - t.Run("GetUpload_NilValue", func(t *testing.T) { + t.Run("GetBaseSha_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumed{} - obj.Upload = nil + obj := &DocumentsInit200ResponseDedupedDocument{} + obj.BaseSha = nil // Act & Assert - assert.Nil(t, obj.GetUpload(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") }) - t.Run("GetUpload_NilReceiver", func(t *testing.T) { + t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumed + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetUpload() // Should return zero value - }) - -} - -func TestSettersMarkExplicitDocumentsInit200ResponseResumed(t *testing.T) { - t.Run("SetDocument_MarksExplicit", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumed{} - var fernTestValueDocument *DocumentsInit200ResponseResumedDocument - - // Act - obj.SetDocument(fernTestValueDocument) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + _ = obj.GetBaseSha() // Should return zero value }) - t.Run("SetUpload_MarksExplicit", func(t *testing.T) { + t.Run("GetStorageSizeBytes", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumed{} - var fernTestValueUpload *DocumentsInit200ResponseResumedUpload - - // Act - obj.SetUpload(fernTestValueUpload) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } - - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip - }) - -} - -func TestSettersDocumentsInit200ResponseResumedDocument(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetTenantID", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueTenantID string - obj.SetTenantID(fernTestValueTenantID) - assert.Equal(t, fernTestValueTenantID, obj.TenantID) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetState", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueState DocumentsInit200ResponseResumedDocumentState - obj.SetState(fernTestValueState) - assert.Equal(t, fernTestValueState, obj.State) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetBaseSha", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueBaseSha *string - obj.SetBaseSha(fernTestValueBaseSha) - assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetStorageSizeBytes", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueStorageSizeBytes *float64 - obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) - assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetMetadata", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueMetadata map[string]any - obj.SetMetadata(fernTestValueMetadata) - assert.Equal(t, fernTestValueMetadata, obj.Metadata) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetIdempotencyKey", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueIdempotencyKey *string - obj.SetIdempotencyKey(fernTestValueIdempotencyKey) - assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetFailureReason", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueFailureReason *string - obj.SetFailureReason(fernTestValueFailureReason) - assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetThumbnailState", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueThumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState - obj.SetThumbnailState(fernTestValueThumbnailState) - assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetThumbnailURL", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueThumbnailURL *string - obj.SetThumbnailURL(fernTestValueThumbnailURL) - assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetCreatedAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueCreatedAt float64 - obj.SetCreatedAt(fernTestValueCreatedAt) - assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetUpdatedAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueUpdatedAt float64 - obj.SetUpdatedAt(fernTestValueUpdatedAt) - assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) - assert.NotNil(t, obj.explicitFields) - }) + obj := &DocumentsInit200ResponseDedupedDocument{} + var expected *float64 + obj.StorageSizeBytes = expected - t.Run("SetCreatedBy", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueCreatedBy *string - obj.SetCreatedBy(fernTestValueCreatedBy) - assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") }) -} - -func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { - t.Run("GetID", func(t *testing.T) { + t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var expected string - obj.ID = expected + obj := &DocumentsInit200ResponseDedupedDocument{} + obj.StorageSizeBytes = nil // Act & Assert - assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") }) - t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetID() // Should return zero value + _ = obj.GetStorageSizeBytes() // Should return zero value }) - t.Run("GetTenantID", func(t *testing.T) { + t.Run("GetMetadata", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var expected string - obj.TenantID = expected + obj := &DocumentsInit200ResponseDedupedDocument{} + var expected map[string]any + obj.Metadata = expected // Act & Assert - assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") - }) - - t.Run("GetTenantID_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetTenantID() // Should return zero value + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") }) - t.Run("GetState", func(t *testing.T) { + t.Run("GetMetadata_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var expected DocumentsInit200ResponseResumedDocumentState - obj.State = expected + obj := &DocumentsInit200ResponseDedupedDocument{} + obj.Metadata = nil // Act & Assert - assert.Equal(t, expected, obj.GetState(), "getter should return the property value") + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") }) - t.Run("GetState_NilReceiver", func(t *testing.T) { + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetState() // Should return zero value + _ = obj.GetMetadata() // Should return zero value }) - t.Run("GetBaseSha", func(t *testing.T) { + t.Run("GetIdempotencyKey", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var expected *string - obj.BaseSha = expected + obj.IdempotencyKey = expected // Act & Assert - assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") }) - t.Run("GetBaseSha_NilValue", func(t *testing.T) { + t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - obj.BaseSha = nil + obj := &DocumentsInit200ResponseDedupedDocument{} + obj.IdempotencyKey = nil // Act & Assert - assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") }) - t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { + t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetBaseSha() // Should return zero value + _ = obj.GetIdempotencyKey() // Should return zero value }) - t.Run("GetStorageSizeBytes", func(t *testing.T) { + t.Run("GetFailureReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var expected *float64 - obj.StorageSizeBytes = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") - }) - - t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - obj.StorageSizeBytes = nil - - // Act & Assert - assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") - }) - - t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetStorageSizeBytes() // Should return zero value - }) - - t.Run("GetMetadata", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var expected map[string]any - obj.Metadata = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") - }) - - t.Run("GetMetadata_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - obj.Metadata = nil - - // Act & Assert - assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") - }) - - t.Run("GetMetadata_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetMetadata() // Should return zero value - }) - - t.Run("GetIdempotencyKey", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var expected *string - obj.IdempotencyKey = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") - }) - - t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - obj.IdempotencyKey = nil - - // Act & Assert - assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") - }) - - t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetIdempotencyKey() // Should return zero value - }) - - t.Run("GetFailureReason", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var expected *string obj.FailureReason = expected @@ -6199,7 +6507,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetFailureReason_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} obj.FailureReason = nil // Act & Assert @@ -6208,7 +6516,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -6221,8 +6529,8 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetThumbnailState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var expected *DocumentsInit200ResponseResumedDocumentThumbnailState + obj := &DocumentsInit200ResponseDedupedDocument{} + var expected *DocumentsInit200ResponseDedupedDocumentThumbnailState obj.ThumbnailState = expected // Act & Assert @@ -6232,7 +6540,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetThumbnailState_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} obj.ThumbnailState = nil // Act & Assert @@ -6241,7 +6549,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -6254,7 +6562,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetThumbnailURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var expected *string obj.ThumbnailURL = expected @@ -6265,7 +6573,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} obj.ThumbnailURL = nil // Act & Assert @@ -6274,7 +6582,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -6287,7 +6595,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var expected float64 obj.CreatedAt = expected @@ -6297,7 +6605,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -6310,7 +6618,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var expected float64 obj.UpdatedAt = expected @@ -6320,7 +6628,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -6333,7 +6641,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetCreatedBy", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var expected *string obj.CreatedBy = expected @@ -6344,7 +6652,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetCreatedBy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} obj.CreatedBy = nil // Act & Assert @@ -6353,7 +6661,7 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedDocument + var obj *DocumentsInit200ResponseDedupedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { @@ -6365,11 +6673,11 @@ func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { } -func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T) { +func TestSettersMarkExplicitDocumentsInit200ResponseDedupedDocument(t *testing.T) { t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueID string // Act @@ -6400,7 +6708,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueTenantID string // Act @@ -6431,8 +6739,8 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetState_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueState DocumentsInit200ResponseResumedDocumentState + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueState DocumentsInit200ResponseDedupedDocumentState // Act obj.SetState(fernTestValueState) @@ -6462,7 +6770,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueBaseSha *string // Act @@ -6493,7 +6801,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueStorageSizeBytes *float64 // Act @@ -6524,7 +6832,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueMetadata map[string]any // Act @@ -6555,7 +6863,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueIdempotencyKey *string // Act @@ -6586,7 +6894,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueFailureReason *string // Act @@ -6617,8 +6925,8 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} - var fernTestValueThumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState + obj := &DocumentsInit200ResponseDedupedDocument{} + var fernTestValueThumbnailState *DocumentsInit200ResponseDedupedDocumentThumbnailState // Act obj.SetThumbnailState(fernTestValueThumbnailState) @@ -6648,7 +6956,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueThumbnailURL *string // Act @@ -6679,7 +6987,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueCreatedAt float64 // Act @@ -6710,7 +7018,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueUpdatedAt float64 // Act @@ -6741,7 +7049,7 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedDocument{} + obj := &DocumentsInit200ResponseDedupedDocument{} var fernTestValueCreatedBy *string // Act @@ -6771,185 +7079,103 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T } -func TestGettersDocumentsInit200ResponseResumedUpload(t *testing.T) { - t.Run("GetKind", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedUpload{} - var expected string - obj.Kind = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") +func TestSettersDocumentsInit200ResponseResumed(t *testing.T) { + t.Run("SetDocument", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumed{} + var fernTestValueDocument *DocumentsInit200ResponseResumedDocument + obj.SetDocument(fernTestValueDocument) + assert.Equal(t, fernTestValueDocument, obj.Document) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetKind_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedUpload - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetKind() // Should return zero value + t.Run("SetUpload", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumed{} + var fernTestValueUpload *DocumentsInit200ResponseResumedUpload + obj.SetUpload(fernTestValueUpload) + assert.Equal(t, fernTestValueUpload, obj.Upload) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetPresigned", func(t *testing.T) { +} + +func TestGettersDocumentsInit200ResponseResumed(t *testing.T) { + t.Run("GetDocument", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUpload{} - var expected *DocumentsInit200ResponseResumedUploadPresigned - obj.Presigned = expected + obj := &DocumentsInit200ResponseResumed{} + var expected *DocumentsInit200ResponseResumedDocument + obj.Document = expected // Act & Assert - assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") + assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") }) - t.Run("GetPresigned_NilValue", func(t *testing.T) { + t.Run("GetDocument_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUpload{} - obj.Presigned = nil + obj := &DocumentsInit200ResponseResumed{} + obj.Document = nil // Act & Assert - assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") }) - t.Run("GetPresigned_NilReceiver", func(t *testing.T) { + t.Run("GetDocument_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedUpload + var obj *DocumentsInit200ResponseResumed // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetPresigned() // Should return zero value + _ = obj.GetDocument() // Should return zero value }) - t.Run("GetProxy", func(t *testing.T) { + t.Run("GetUpload", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUpload{} - var expected *DocumentsInit200ResponseResumedUploadProxy - obj.Proxy = expected + obj := &DocumentsInit200ResponseResumed{} + var expected *DocumentsInit200ResponseResumedUpload + obj.Upload = expected // Act & Assert - assert.Equal(t, expected, obj.GetProxy(), "getter should return the property value") + assert.Equal(t, expected, obj.GetUpload(), "getter should return the property value") }) - t.Run("GetProxy_NilValue", func(t *testing.T) { + t.Run("GetUpload_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUpload{} - obj.Proxy = nil + obj := &DocumentsInit200ResponseResumed{} + obj.Upload = nil // Act & Assert - assert.Nil(t, obj.GetProxy(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetUpload(), "getter should return nil when property is nil") }) - t.Run("GetProxy_NilReceiver", func(t *testing.T) { + t.Run("GetUpload_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedUpload + var obj *DocumentsInit200ResponseResumed // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetProxy() // Should return zero value + _ = obj.GetUpload() // Should return zero value }) } -func TestSettersDocumentsInit200ResponseResumedUploadPresigned(t *testing.T) { - t.Run("SetPresigned", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadPresigned{} - var fernTestValuePresigned *DocumentsInit200ResponseResumedUploadPresignedPresigned - obj.SetPresigned(fernTestValuePresigned) - assert.Equal(t, fernTestValuePresigned, obj.Presigned) - assert.NotNil(t, obj.explicitFields) - }) - - t.Run("SetKey", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadPresigned{} - var fernTestValueKey string - obj.SetKey(fernTestValueKey) - assert.Equal(t, fernTestValueKey, obj.Key) - assert.NotNil(t, obj.explicitFields) - }) - -} - -func TestGettersDocumentsInit200ResponseResumedUploadPresigned(t *testing.T) { - t.Run("GetPresigned", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresigned{} - var expected *DocumentsInit200ResponseResumedUploadPresignedPresigned - obj.Presigned = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") - }) - - t.Run("GetPresigned_NilValue", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresigned{} - obj.Presigned = nil - - // Act & Assert - assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") - }) - - t.Run("GetPresigned_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadPresigned - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetPresigned() // Should return zero value - }) - - t.Run("GetKey", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresigned{} - var expected string - obj.Key = expected - - // Act & Assert - assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") - }) - - t.Run("GetKey_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadPresigned - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetKey() // Should return zero value - }) - -} - -func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadPresigned(t *testing.T) { - t.Run("SetPresigned_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDocumentsInit200ResponseResumed(t *testing.T) { + t.Run("SetDocument_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresigned{} - var fernTestValuePresigned *DocumentsInit200ResponseResumedUploadPresignedPresigned + obj := &DocumentsInit200ResponseResumed{} + var fernTestValueDocument *DocumentsInit200ResponseResumedDocument // Act - obj.SetPresigned(fernTestValuePresigned) + obj.SetDocument(fernTestValueDocument) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -6973,14 +7199,14 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadPresigned(t *te // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Run("SetUpload_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresigned{} - var fernTestValueKey string + obj := &DocumentsInit200ResponseResumed{} + var fernTestValueUpload *DocumentsInit200ResponseResumedUpload // Act - obj.SetKey(fernTestValueKey) + obj.SetUpload(fernTestValueUpload) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -7006,503 +7232,504 @@ func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadPresigned(t *te } -func TestSettersDocumentsInit200ResponseResumedUploadPresignedPresigned(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) +func TestSettersDocumentsInit200ResponseResumedDocument(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetHeaders", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueHeaders map[string]string - obj.SetHeaders(fernTestValueHeaders) - assert.Equal(t, fernTestValueHeaders, obj.Headers) + t.Run("SetTenantID", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetMethod", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueMethod DocumentsInit200ResponseResumedUploadPresignedPresignedMethod - obj.SetMethod(fernTestValueMethod) - assert.Equal(t, fernTestValueMethod, obj.Method) + t.Run("SetState", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueState DocumentsInit200ResponseResumedDocumentState + obj.SetState(fernTestValueState) + assert.Equal(t, fernTestValueState, obj.State) assert.NotNil(t, obj.explicitFields) }) - t.Run("SetExpiresAt", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueExpiresAt float64 - obj.SetExpiresAt(fernTestValueExpiresAt) - assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + t.Run("SetBaseSha", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueBaseSha *string + obj.SetBaseSha(fernTestValueBaseSha) + assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) assert.NotNil(t, obj.explicitFields) }) -} + t.Run("SetStorageSizeBytes", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueStorageSizeBytes *float64 + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) + assert.NotNil(t, obj.explicitFields) + }) -func TestGettersDocumentsInit200ResponseResumedUploadPresignedPresigned(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var expected string - obj.URL = expected + t.Run("SetMetadata", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueMetadata map[string]any + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + t.Run("SetIdempotencyKey", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueIdempotencyKey *string + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetURL() // Should return zero value + t.Run("SetFailureReason", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueFailureReason *string + obj.SetFailureReason(fernTestValueFailureReason) + assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetHeaders", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var expected map[string]string - obj.Headers = expected + t.Run("SetThumbnailState", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueThumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState + obj.SetThumbnailState(fernTestValueThumbnailState) + assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) + assert.NotNil(t, obj.explicitFields) + }) - // Act & Assert - assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") + t.Run("SetThumbnailURL", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueThumbnailURL *string + obj.SetThumbnailURL(fernTestValueThumbnailURL) + assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) + assert.NotNil(t, obj.explicitFields) }) - t.Run("GetHeaders_NilValue", func(t *testing.T) { + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueCreatedAt float64 + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueUpdatedAt float64 + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedBy", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueCreatedBy *string + obj.SetCreatedBy(fernTestValueCreatedBy) + assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseResumedDocument(t *testing.T) { + t.Run("GetID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - obj.Headers = nil + obj := &DocumentsInit200ResponseResumedDocument{} + var expected string + obj.ID = expected // Act & Assert - assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") }) - t.Run("GetHeaders_NilReceiver", func(t *testing.T) { + t.Run("GetID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned + var obj *DocumentsInit200ResponseResumedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetHeaders() // Should return zero value + _ = obj.GetID() // Should return zero value }) - t.Run("GetMethod", func(t *testing.T) { + t.Run("GetTenantID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var expected DocumentsInit200ResponseResumedUploadPresignedPresignedMethod - obj.Method = expected + obj := &DocumentsInit200ResponseResumedDocument{} + var expected string + obj.TenantID = expected // Act & Assert - assert.Equal(t, expected, obj.GetMethod(), "getter should return the property value") + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") }) - t.Run("GetMethod_NilReceiver", func(t *testing.T) { + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned + var obj *DocumentsInit200ResponseResumedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetMethod() // Should return zero value + _ = obj.GetTenantID() // Should return zero value }) - t.Run("GetExpiresAt", func(t *testing.T) { + t.Run("GetState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var expected float64 - obj.ExpiresAt = expected + obj := &DocumentsInit200ResponseResumedDocument{} + var expected DocumentsInit200ResponseResumedDocumentState + obj.State = expected // Act & Assert - assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") + assert.Equal(t, expected, obj.GetState(), "getter should return the property value") }) - t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { + t.Run("GetState_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned + var obj *DocumentsInit200ResponseResumedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetExpiresAt() // Should return zero value + _ = obj.GetState() // Should return zero value }) -} - -func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadPresignedPresigned(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("GetBaseSha", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueURL string - - // Act - obj.SetURL(fernTestValueURL) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &DocumentsInit200ResponseResumedDocument{} + var expected *string + obj.BaseSha = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") }) - t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { + t.Run("GetBaseSha_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueHeaders map[string]string - - // Act - obj.SetHeaders(fernTestValueHeaders) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + obj := &DocumentsInit200ResponseResumedDocument{} + obj.BaseSha = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBaseSha() // Should return zero value }) - t.Run("SetMethod_MarksExplicit", func(t *testing.T) { + t.Run("GetStorageSizeBytes", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueMethod DocumentsInit200ResponseResumedUploadPresignedPresignedMethod - - // Act - obj.SetMethod(fernTestValueMethod) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &DocumentsInit200ResponseResumedDocument{} + var expected *float64 + obj.StorageSizeBytes = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") }) - t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { + t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} - var fernTestValueExpiresAt float64 - - // Act - obj.SetExpiresAt(fernTestValueExpiresAt) - - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") - - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + obj := &DocumentsInit200ResponseResumedDocument{} + obj.StorageSizeBytes = nil - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") }) -} - -func TestSettersDocumentsInit200ResponseResumedUploadProxy(t *testing.T) { - t.Run("SetURL", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadProxy{} - var fernTestValueURL string - obj.SetURL(fernTestValueURL) - assert.Equal(t, fernTestValueURL, obj.URL) - assert.NotNil(t, obj.explicitFields) + t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStorageSizeBytes() // Should return zero value }) - t.Run("SetKey", func(t *testing.T) { - obj := &DocumentsInit200ResponseResumedUploadProxy{} - var fernTestValueKey string - obj.SetKey(fernTestValueKey) - assert.Equal(t, fernTestValueKey, obj.Key) - assert.NotNil(t, obj.explicitFields) - }) + t.Run("GetMetadata", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var expected map[string]any + obj.Metadata = expected -} + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) -func TestGettersDocumentsInit200ResponseResumedUploadProxy(t *testing.T) { - t.Run("GetURL", func(t *testing.T) { + t.Run("GetMetadata_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadProxy{} - var expected string - obj.URL = expected + obj := &DocumentsInit200ResponseResumedDocument{} + obj.Metadata = nil // Act & Assert - assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") }) - t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadProxy + var obj *DocumentsInit200ResponseResumedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetURL() // Should return zero value + _ = obj.GetMetadata() // Should return zero value }) - t.Run("GetKey", func(t *testing.T) { + t.Run("GetIdempotencyKey", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadProxy{} - var expected string - obj.Key = expected + obj := &DocumentsInit200ResponseResumedDocument{} + var expected *string + obj.IdempotencyKey = expected // Act & Assert - assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") }) - t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { t.Parallel() - var obj *DocumentsInit200ResponseResumedUploadProxy + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + obj.IdempotencyKey = nil + + // Act & Assert + assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") + }) + + t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetKey() // Should return zero value + _ = obj.GetIdempotencyKey() // Should return zero value }) -} - -func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadProxy(t *testing.T) { - t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Run("GetFailureReason", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadProxy{} - var fernTestValueURL string + obj := &DocumentsInit200ResponseResumedDocument{} + var expected *string + obj.FailureReason = expected - // Act - obj.SetURL(fernTestValueURL) + // Act & Assert + assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetFailureReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + obj.FailureReason = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailureReason() // Should return zero value }) - t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Run("GetThumbnailState", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsInit200ResponseResumedUploadProxy{} - var fernTestValueKey string + obj := &DocumentsInit200ResponseResumedDocument{} + var expected *DocumentsInit200ResponseResumedDocumentThumbnailState + obj.ThumbnailState = expected - // Act - obj.SetKey(fernTestValueKey) + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetThumbnailState_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + obj.ThumbnailState = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailState() // Should return zero value }) -} + t.Run("GetThumbnailURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var expected *string + obj.ThumbnailURL = expected -func TestSettersDocumentsList200Response(t *testing.T) { - t.Run("SetDocuments", func(t *testing.T) { - obj := &DocumentsList200Response{} - var fernTestValueDocuments []*DocumentsList200ResponseDocumentsItem - obj.SetDocuments(fernTestValueDocuments) - assert.Equal(t, fernTestValueDocuments, obj.Documents) - assert.NotNil(t, obj.explicitFields) + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") }) - t.Run("SetNextCursor", func(t *testing.T) { - obj := &DocumentsList200Response{} - var fernTestValueNextCursor *string - obj.SetNextCursor(fernTestValueNextCursor) - assert.Equal(t, fernTestValueNextCursor, obj.NextCursor) - assert.NotNil(t, obj.explicitFields) + t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + obj.ThumbnailURL = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") }) -} + t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailURL() // Should return zero value + }) -func TestGettersDocumentsList200Response(t *testing.T) { - t.Run("GetDocuments", func(t *testing.T) { + t.Run("GetCreatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200Response{} - var expected []*DocumentsList200ResponseDocumentsItem - obj.Documents = expected + obj := &DocumentsInit200ResponseResumedDocument{} + var expected float64 + obj.CreatedAt = expected // Act & Assert - assert.Equal(t, expected, obj.GetDocuments(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") }) - t.Run("GetDocuments_NilValue", func(t *testing.T) { + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200Response{} - obj.Documents = nil + obj := &DocumentsInit200ResponseResumedDocument{} + var expected float64 + obj.UpdatedAt = expected // Act & Assert - assert.Nil(t, obj.GetDocuments(), "getter should return nil when property is nil") + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") }) - t.Run("GetDocuments_NilReceiver", func(t *testing.T) { + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsList200Response + var obj *DocumentsInit200ResponseResumedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetDocuments() // Should return zero value + _ = obj.GetUpdatedAt() // Should return zero value }) - t.Run("GetNextCursor", func(t *testing.T) { + t.Run("GetCreatedBy", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200Response{} + obj := &DocumentsInit200ResponseResumedDocument{} var expected *string - obj.NextCursor = expected + obj.CreatedBy = expected // Act & Assert - assert.Equal(t, expected, obj.GetNextCursor(), "getter should return the property value") + assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") }) - t.Run("GetNextCursor_NilValue", func(t *testing.T) { + t.Run("GetCreatedBy_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200Response{} - obj.NextCursor = nil + obj := &DocumentsInit200ResponseResumedDocument{} + obj.CreatedBy = nil // Act & Assert - assert.Nil(t, obj.GetNextCursor(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") }) - t.Run("GetNextCursor_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsList200Response + var obj *DocumentsInit200ResponseResumedDocument // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetNextCursor() // Should return zero value + _ = obj.GetCreatedBy() // Should return zero value }) } -func TestSettersMarkExplicitDocumentsList200Response(t *testing.T) { - t.Run("SetDocuments_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDocumentsInit200ResponseResumedDocument(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200Response{} - var fernTestValueDocuments []*DocumentsList200ResponseDocumentsItem + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueID string // Act - obj.SetDocuments(fernTestValueDocuments) + obj.SetID(fernTestValueID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -7526,14 +7753,14 @@ func TestSettersMarkExplicitDocumentsList200Response(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetNextCursor_MarksExplicit", func(t *testing.T) { + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200Response{} - var fernTestValueNextCursor *string + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueTenantID string // Act - obj.SetNextCursor(fernTestValueNextCursor) + obj.SetTenantID(fernTestValueTenantID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -7557,44 +7784,1173 @@ func TestSettersMarkExplicitDocumentsList200Response(t *testing.T) { // It verifies that setting a field via setter allows successful JSON round-trip }) -} + t.Run("SetState_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueState DocumentsInit200ResponseResumedDocumentState -func TestSettersDocumentsList200ResponseDocumentsItem(t *testing.T) { - t.Run("SetID", func(t *testing.T) { - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueID string - obj.SetID(fernTestValueID) - assert.Equal(t, fernTestValueID, obj.ID) - assert.NotNil(t, obj.explicitFields) - }) + // Act + obj.SetState(fernTestValueState) - t.Run("SetTenantID", func(t *testing.T) { - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueTenantID string - obj.SetTenantID(fernTestValueTenantID) - assert.Equal(t, fernTestValueTenantID, obj.TenantID) - assert.NotNil(t, obj.explicitFields) - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("SetState", func(t *testing.T) { - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueState DocumentsList200ResponseDocumentsItemState - obj.SetState(fernTestValueState) - assert.Equal(t, fernTestValueState, obj.State) - assert.NotNil(t, obj.explicitFields) + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetBaseSha", func(t *testing.T) { - obj := &DocumentsList200ResponseDocumentsItem{} + t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} var fernTestValueBaseSha *string + + // Act obj.SetBaseSha(fernTestValueBaseSha) - assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) - assert.NotNil(t, obj.explicitFields) - }) - t.Run("SetStorageSizeBytes", func(t *testing.T) { - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueStorageSizeBytes *float64 + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueStorageSizeBytes *float64 + + // Act + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueMetadata map[string]any + + // Act + obj.SetMetadata(fernTestValueMetadata) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueIdempotencyKey *string + + // Act + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueFailureReason *string + + // Act + obj.SetFailureReason(fernTestValueFailureReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueThumbnailState *DocumentsInit200ResponseResumedDocumentThumbnailState + + // Act + obj.SetThumbnailState(fernTestValueThumbnailState) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueThumbnailURL *string + + // Act + obj.SetThumbnailURL(fernTestValueThumbnailURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueCreatedAt float64 + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueUpdatedAt float64 + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedDocument{} + var fernTestValueCreatedBy *string + + // Act + obj.SetCreatedBy(fernTestValueCreatedBy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestGettersDocumentsInit200ResponseResumedUpload(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUpload{} + var expected string + obj.Kind = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + }) + + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUpload + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) + + t.Run("GetPresigned", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUpload{} + var expected *DocumentsInit200ResponseResumedUploadPresigned + obj.Presigned = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") + }) + + t.Run("GetPresigned_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUpload{} + obj.Presigned = nil + + // Act & Assert + assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") + }) + + t.Run("GetPresigned_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUpload + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPresigned() // Should return zero value + }) + + t.Run("GetProxy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUpload{} + var expected *DocumentsInit200ResponseResumedUploadProxy + obj.Proxy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetProxy(), "getter should return the property value") + }) + + t.Run("GetProxy_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUpload{} + obj.Proxy = nil + + // Act & Assert + assert.Nil(t, obj.GetProxy(), "getter should return nil when property is nil") + }) + + t.Run("GetProxy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUpload + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetProxy() // Should return zero value + }) + +} + +func TestSettersDocumentsInit200ResponseResumedUploadPresigned(t *testing.T) { + t.Run("SetPresigned", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadPresigned{} + var fernTestValuePresigned *DocumentsInit200ResponseResumedUploadPresignedPresigned + obj.SetPresigned(fernTestValuePresigned) + assert.Equal(t, fernTestValuePresigned, obj.Presigned) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKey", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadPresigned{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseResumedUploadPresigned(t *testing.T) { + t.Run("GetPresigned", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresigned{} + var expected *DocumentsInit200ResponseResumedUploadPresignedPresigned + obj.Presigned = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetPresigned(), "getter should return the property value") + }) + + t.Run("GetPresigned_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresigned{} + obj.Presigned = nil + + // Act & Assert + assert.Nil(t, obj.GetPresigned(), "getter should return nil when property is nil") + }) + + t.Run("GetPresigned_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadPresigned + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetPresigned() // Should return zero value + }) + + t.Run("GetKey", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresigned{} + var expected string + obj.Key = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + }) + + t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadPresigned + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKey() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadPresigned(t *testing.T) { + t.Run("SetPresigned_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresigned{} + var fernTestValuePresigned *DocumentsInit200ResponseResumedUploadPresignedPresigned + + // Act + obj.SetPresigned(fernTestValuePresigned) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresigned{} + var fernTestValueKey string + + // Act + obj.SetKey(fernTestValueKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsInit200ResponseResumedUploadPresignedPresigned(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetHeaders", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueHeaders map[string]string + obj.SetHeaders(fernTestValueHeaders) + assert.Equal(t, fernTestValueHeaders, obj.Headers) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMethod", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueMethod DocumentsInit200ResponseResumedUploadPresignedPresignedMethod + obj.SetMethod(fernTestValueMethod) + assert.Equal(t, fernTestValueMethod, obj.Method) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExpiresAt", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueExpiresAt float64 + obj.SetExpiresAt(fernTestValueExpiresAt) + assert.Equal(t, fernTestValueExpiresAt, obj.ExpiresAt) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseResumedUploadPresignedPresigned(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var expected string + obj.URL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) + + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value + }) + + t.Run("GetHeaders", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var expected map[string]string + obj.Headers = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetHeaders(), "getter should return the property value") + }) + + t.Run("GetHeaders_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + obj.Headers = nil + + // Act & Assert + assert.Nil(t, obj.GetHeaders(), "getter should return nil when property is nil") + }) + + t.Run("GetHeaders_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetHeaders() // Should return zero value + }) + + t.Run("GetMethod", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var expected DocumentsInit200ResponseResumedUploadPresignedPresignedMethod + obj.Method = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMethod(), "getter should return the property value") + }) + + t.Run("GetMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMethod() // Should return zero value + }) + + t.Run("GetExpiresAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var expected float64 + obj.ExpiresAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExpiresAt(), "getter should return the property value") + }) + + t.Run("GetExpiresAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadPresignedPresigned + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExpiresAt() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadPresignedPresigned(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueURL string + + // Act + obj.SetURL(fernTestValueURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetHeaders_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueHeaders map[string]string + + // Act + obj.SetHeaders(fernTestValueHeaders) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMethod_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueMethod DocumentsInit200ResponseResumedUploadPresignedPresignedMethod + + // Act + obj.SetMethod(fernTestValueMethod) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExpiresAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadPresignedPresigned{} + var fernTestValueExpiresAt float64 + + // Act + obj.SetExpiresAt(fernTestValueExpiresAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsInit200ResponseResumedUploadProxy(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadProxy{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetKey", func(t *testing.T) { + obj := &DocumentsInit200ResponseResumedUploadProxy{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsInit200ResponseResumedUploadProxy(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadProxy{} + var expected string + obj.URL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") + }) + + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadProxy + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value + }) + + t.Run("GetKey", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadProxy{} + var expected string + obj.Key = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") + }) + + t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsInit200ResponseResumedUploadProxy + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKey() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsInit200ResponseResumedUploadProxy(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadProxy{} + var fernTestValueURL string + + // Act + obj.SetURL(fernTestValueURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsInit200ResponseResumedUploadProxy{} + var fernTestValueKey string + + // Act + obj.SetKey(fernTestValueKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsList200Response(t *testing.T) { + t.Run("SetDocuments", func(t *testing.T) { + obj := &DocumentsList200Response{} + var fernTestValueDocuments []*DocumentsList200ResponseDocumentsItem + obj.SetDocuments(fernTestValueDocuments) + assert.Equal(t, fernTestValueDocuments, obj.Documents) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetNextCursor", func(t *testing.T) { + obj := &DocumentsList200Response{} + var fernTestValueNextCursor *string + obj.SetNextCursor(fernTestValueNextCursor) + assert.Equal(t, fernTestValueNextCursor, obj.NextCursor) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsList200Response(t *testing.T) { + t.Run("GetDocuments", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200Response{} + var expected []*DocumentsList200ResponseDocumentsItem + obj.Documents = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDocuments(), "getter should return the property value") + }) + + t.Run("GetDocuments_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200Response{} + obj.Documents = nil + + // Act & Assert + assert.Nil(t, obj.GetDocuments(), "getter should return nil when property is nil") + }) + + t.Run("GetDocuments_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDocuments() // Should return zero value + }) + + t.Run("GetNextCursor", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200Response{} + var expected *string + obj.NextCursor = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetNextCursor(), "getter should return the property value") + }) + + t.Run("GetNextCursor_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200Response{} + obj.NextCursor = nil + + // Act & Assert + assert.Nil(t, obj.GetNextCursor(), "getter should return nil when property is nil") + }) + + t.Run("GetNextCursor_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetNextCursor() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsList200Response(t *testing.T) { + t.Run("SetDocuments_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200Response{} + var fernTestValueDocuments []*DocumentsList200ResponseDocumentsItem + + // Act + obj.SetDocuments(fernTestValueDocuments) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetNextCursor_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200Response{} + var fernTestValueNextCursor *string + + // Act + obj.SetNextCursor(fernTestValueNextCursor) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsList200ResponseDocumentsItem(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DocumentsList200ResponseDocumentsItem{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTenantID", func(t *testing.T) { + obj := &DocumentsList200ResponseDocumentsItem{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetState", func(t *testing.T) { + obj := &DocumentsList200ResponseDocumentsItem{} + var fernTestValueState DocumentsList200ResponseDocumentsItemState + obj.SetState(fernTestValueState) + assert.Equal(t, fernTestValueState, obj.State) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBaseSha", func(t *testing.T) { + obj := &DocumentsList200ResponseDocumentsItem{} + var fernTestValueBaseSha *string + obj.SetBaseSha(fernTestValueBaseSha) + assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStorageSizeBytes", func(t *testing.T) { + obj := &DocumentsList200ResponseDocumentsItem{} + var fernTestValueStorageSizeBytes *float64 obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) assert.NotNil(t, obj.explicitFields) @@ -7853,10 +9209,188 @@ func TestGettersDocumentsList200ResponseDocumentsItem(t *testing.T) { obj.IdempotencyKey = nil // Act & Assert - assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") + assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") + }) + + t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200ResponseDocumentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIdempotencyKey() // Should return zero value + }) + + t.Run("GetFailureReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var expected *string + obj.FailureReason = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") + }) + + t.Run("GetFailureReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + obj.FailureReason = nil + + // Act & Assert + assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") + }) + + t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200ResponseDocumentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailureReason() // Should return zero value + }) + + t.Run("GetThumbnailState", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var expected *DocumentsList200ResponseDocumentsItemThumbnailState + obj.ThumbnailState = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") + }) + + t.Run("GetThumbnailState_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + obj.ThumbnailState = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200ResponseDocumentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailState() // Should return zero value + }) + + t.Run("GetThumbnailURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var expected *string + obj.ThumbnailURL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") + }) + + t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + obj.ThumbnailURL = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200ResponseDocumentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailURL() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var expected float64 + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200ResponseDocumentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var expected float64 + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsList200ResponseDocumentsItem + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + + t.Run("GetCreatedBy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var expected *string + obj.CreatedBy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") + }) + + t.Run("GetCreatedBy_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + obj.CreatedBy = nil + + // Act & Assert + assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") }) - t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { + t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { t.Parallel() var obj *DocumentsList200ResponseDocumentsItem // Should not panic - getters should handle nil receiver gracefully @@ -7865,198 +9399,361 @@ func TestGettersDocumentsList200ResponseDocumentsItem(t *testing.T) { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetIdempotencyKey() // Should return zero value + _ = obj.GetCreatedBy() // Should return zero value }) - t.Run("GetFailureReason", func(t *testing.T) { +} + +func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - var expected *string - obj.FailureReason = expected + var fernTestValueID string - // Act & Assert - assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetFailureReason_NilValue", func(t *testing.T) { + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - obj.FailureReason = nil + var fernTestValueTenantID string - // Act & Assert - assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") + // Act + obj.SetTenantID(fernTestValueTenantID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Run("SetState_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *DocumentsList200ResponseDocumentsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetFailureReason() // Should return zero value + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var fernTestValueState DocumentsList200ResponseDocumentsItemState + + // Act + obj.SetState(fernTestValueState) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetThumbnailState", func(t *testing.T) { + t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - var expected *DocumentsList200ResponseDocumentsItemThumbnailState - obj.ThumbnailState = expected + var fernTestValueBaseSha *string - // Act & Assert - assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") + // Act + obj.SetBaseSha(fernTestValueBaseSha) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetThumbnailState_NilValue", func(t *testing.T) { + t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - obj.ThumbnailState = nil + var fernTestValueStorageSizeBytes *float64 - // Act & Assert - assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + // Act + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { t.Parallel() - var obj *DocumentsList200ResponseDocumentsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetThumbnailState() // Should return zero value + // Arrange + obj := &DocumentsList200ResponseDocumentsItem{} + var fernTestValueMetadata map[string]any + + // Act + obj.SetMetadata(fernTestValueMetadata) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetThumbnailURL", func(t *testing.T) { + t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - var expected *string - obj.ThumbnailURL = expected + var fernTestValueIdempotencyKey *string - // Act & Assert - assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") + // Act + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { + t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - obj.ThumbnailURL = nil + var fernTestValueFailureReason *string - // Act & Assert - assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") - }) + // Act + obj.SetFailureReason(fernTestValueFailureReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsList200ResponseDocumentsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetThumbnailURL() // Should return zero value + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCreatedAt", func(t *testing.T) { + t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - var expected float64 - obj.CreatedAt = expected + var fernTestValueThumbnailState *DocumentsList200ResponseDocumentsItemThumbnailState - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") - }) + // Act + obj.SetThumbnailState(fernTestValueThumbnailState) - t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsList200ResponseDocumentsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedAt() // Should return zero value + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetUpdatedAt", func(t *testing.T) { + t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - var expected float64 - obj.UpdatedAt = expected + var fernTestValueThumbnailURL *string - // Act & Assert - assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") - }) + // Act + obj.SetThumbnailURL(fernTestValueThumbnailURL) - t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsList200ResponseDocumentsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetUpdatedAt() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") - t.Run("GetCreatedBy", func(t *testing.T) { - t.Parallel() - // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var expected *string - obj.CreatedBy = expected + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } - // Act & Assert - assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("GetCreatedBy_NilValue", func(t *testing.T) { + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - obj.CreatedBy = nil + var fernTestValueCreatedAt float64 - // Act & Assert - assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") - }) + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) - t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { - t.Parallel() - var obj *DocumentsList200ResponseDocumentsItem - // Should not panic - getters should handle nil receiver gracefully - defer func() { - if r := recover(); r != nil { - t.Errorf("Getter panicked on nil receiver: %v", r) - } - }() - _ = obj.GetCreatedBy() // Should return zero value - }) + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") -} + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } -func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) { - t.Run("SetID_MarksExplicit", func(t *testing.T) { + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueID string + var fernTestValueUpdatedAt float64 // Act - obj.SetID(fernTestValueID) + obj.SetUpdatedAt(fernTestValueUpdatedAt) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8080,14 +9777,14 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueTenantID string + var fernTestValueCreatedBy *string // Act - obj.SetTenantID(fernTestValueTenantID) + obj.SetCreatedBy(fernTestValueCreatedBy) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8111,14 +9808,54 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetState_MarksExplicit", func(t *testing.T) { +} + +func TestSettersDocumentsUploadProxy200Response(t *testing.T) { + t.Run("SetSha256", func(t *testing.T) { + obj := &DocumentsUploadProxy200Response{} + var fernTestValueSha256 string + obj.SetSha256(fernTestValueSha256) + assert.Equal(t, fernTestValueSha256, obj.Sha256) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsUploadProxy200Response(t *testing.T) { + t.Run("GetSha256", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueState DocumentsList200ResponseDocumentsItemState + obj := &DocumentsUploadProxy200Response{} + var expected string + obj.Sha256 = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSha256(), "getter should return the property value") + }) + + t.Run("GetSha256_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsUploadProxy200Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSha256() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsUploadProxy200Response(t *testing.T) { + t.Run("SetSha256_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsUploadProxy200Response{} + var fernTestValueSha256 string // Act - obj.SetState(fernTestValueState) + obj.SetSha256(fernTestValueSha256) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8138,18 +9875,109 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) require.NoError(t, err, "unmarshaling should succeed for test verification") } - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFromRequestExpected(t *testing.T) { + t.Run("SetSizeBytes", func(t *testing.T) { + obj := &DocumentsImportFromRequestExpected{} + var fernTestValueSizeBytes *int + obj.SetSizeBytes(fernTestValueSizeBytes) + assert.Equal(t, fernTestValueSizeBytes, obj.SizeBytes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetSha256", func(t *testing.T) { + obj := &DocumentsImportFromRequestExpected{} + var fernTestValueSha256 *string + obj.SetSha256(fernTestValueSha256) + assert.Equal(t, fernTestValueSha256, obj.Sha256) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFromRequestExpected(t *testing.T) { + t.Run("GetSizeBytes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestExpected{} + var expected *int + obj.SizeBytes = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSizeBytes(), "getter should return the property value") + }) + + t.Run("GetSizeBytes_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestExpected{} + obj.SizeBytes = nil + + // Act & Assert + assert.Nil(t, obj.GetSizeBytes(), "getter should return nil when property is nil") + }) + + t.Run("GetSizeBytes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestExpected + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSizeBytes() // Should return zero value + }) + + t.Run("GetSha256", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestExpected{} + var expected *string + obj.Sha256 = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetSha256(), "getter should return the property value") + }) + + t.Run("GetSha256_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestExpected{} + obj.Sha256 = nil + + // Act & Assert + assert.Nil(t, obj.GetSha256(), "getter should return nil when property is nil") + }) + + t.Run("GetSha256_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestExpected + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetSha256() // Should return zero value }) - t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitDocumentsImportFromRequestExpected(t *testing.T) { + t.Run("SetSizeBytes_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueBaseSha *string + obj := &DocumentsImportFromRequestExpected{} + var fernTestValueSizeBytes *int // Act - obj.SetBaseSha(fernTestValueBaseSha) + obj.SetSizeBytes(fernTestValueSizeBytes) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8173,14 +10001,14 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { + t.Run("SetSha256_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueStorageSizeBytes *float64 + obj := &DocumentsImportFromRequestExpected{} + var fernTestValueSha256 *string // Act - obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + obj.SetSha256(fernTestValueSha256) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8204,169 +10032,218 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { +} + +func TestGettersDocumentsImportFromRequestSource(t *testing.T) { + t.Run("GetKind", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueMetadata map[string]any + obj := &DocumentsImportFromRequestSource{} + var expected string + obj.Kind = expected - // Act - obj.SetMetadata(fernTestValueMetadata) + // Act & Assert + assert.Equal(t, expected, obj.GetKind(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetKind_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSource + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKind() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestSource{} + var expected *DocumentsImportFromRequestSourceURL + obj.URL = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { + t.Run("GetURL_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueIdempotencyKey *string + obj := &DocumentsImportFromRequestSource{} + obj.URL = nil - // Act - obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + // Act & Assert + assert.Nil(t, obj.GetURL(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSource + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetURL() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetConnection", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestSource{} + var expected *DocumentsImportFromRequestSourceConnection + obj.Connection = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetConnection(), "getter should return the property value") }) - t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { + t.Run("GetConnection_NilValue", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueFailureReason *string + obj := &DocumentsImportFromRequestSource{} + obj.Connection = nil - // Act - obj.SetFailureReason(fernTestValueFailureReason) + // Act & Assert + assert.Nil(t, obj.GetConnection(), "getter should return nil when property is nil") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetConnection_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSource + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetConnection() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } +} - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip +func TestSettersDocumentsImportFromRequestSourceConnection(t *testing.T) { + t.Run("SetConnectionID", func(t *testing.T) { + obj := &DocumentsImportFromRequestSourceConnection{} + var fernTestValueConnectionID string + obj.SetConnectionID(fernTestValueConnectionID) + assert.Equal(t, fernTestValueConnectionID, obj.ConnectionID) + assert.NotNil(t, obj.explicitFields) }) - t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { + t.Run("SetKey", func(t *testing.T) { + obj := &DocumentsImportFromRequestSourceConnection{} + var fernTestValueKey string + obj.SetKey(fernTestValueKey) + assert.Equal(t, fernTestValueKey, obj.Key) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetRevision", func(t *testing.T) { + obj := &DocumentsImportFromRequestSourceConnection{} + var fernTestValueRevision *string + obj.SetRevision(fernTestValueRevision) + assert.Equal(t, fernTestValueRevision, obj.Revision) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFromRequestSourceConnection(t *testing.T) { + t.Run("GetConnectionID", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueThumbnailState *DocumentsList200ResponseDocumentsItemThumbnailState + obj := &DocumentsImportFromRequestSourceConnection{} + var expected string + obj.ConnectionID = expected - // Act - obj.SetThumbnailState(fernTestValueThumbnailState) + // Act & Assert + assert.Equal(t, expected, obj.GetConnectionID(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetConnectionID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSourceConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetConnectionID() // Should return zero value + }) - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + t.Run("GetKey", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestSourceConnection{} + var expected string + obj.Key = expected - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + // Act & Assert + assert.Equal(t, expected, obj.GetKey(), "getter should return the property value") }) - t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { + t.Run("GetKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSourceConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetKey() // Should return zero value + }) + + t.Run("GetRevision", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueThumbnailURL *string + obj := &DocumentsImportFromRequestSourceConnection{} + var expected *string + obj.Revision = expected - // Act - obj.SetThumbnailURL(fernTestValueThumbnailURL) + // Act & Assert + assert.Equal(t, expected, obj.GetRevision(), "getter should return the property value") + }) - // Assert - object with explicitly set field can be marshaled/unmarshaled - bytes, err := json.Marshal(obj) - require.NoError(t, err, "marshaling should succeed for test setup") + t.Run("GetRevision_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestSourceConnection{} + obj.Revision = nil - // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value - // Detect if marshaled JSON is an object or primitive to use correct unmarshal target - if len(bytes) > 0 && bytes[0] == '{' { - // JSON object - unmarshal into map - var unmarshaled map[string]interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } else { - // JSON primitive (string, number, boolean, null) - unmarshal into interface{} - var unmarshaled interface{} - err = json.Unmarshal(bytes, &unmarshaled) - require.NoError(t, err, "unmarshaling should succeed for test verification") - } + // Act & Assert + assert.Nil(t, obj.GetRevision(), "getter should return nil when property is nil") + }) - // Note: This does not explicitly assert the presence of a specific JSON field - // It verifies that setting a field via setter allows successful JSON round-trip + t.Run("GetRevision_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSourceConnection + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetRevision() // Should return zero value }) - t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { +} + +func TestSettersMarkExplicitDocumentsImportFromRequestSourceConnection(t *testing.T) { + t.Run("SetConnectionID_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueCreatedAt float64 + obj := &DocumentsImportFromRequestSourceConnection{} + var fernTestValueConnectionID string // Act - obj.SetCreatedAt(fernTestValueCreatedAt) + obj.SetConnectionID(fernTestValueConnectionID) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8390,14 +10267,14 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Run("SetKey_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueUpdatedAt float64 + obj := &DocumentsImportFromRequestSourceConnection{} + var fernTestValueKey string // Act - obj.SetUpdatedAt(fernTestValueUpdatedAt) + obj.SetKey(fernTestValueKey) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8421,14 +10298,14 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) // It verifies that setting a field via setter allows successful JSON round-trip }) - t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { + t.Run("SetRevision_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsList200ResponseDocumentsItem{} - var fernTestValueCreatedBy *string + obj := &DocumentsImportFromRequestSourceConnection{} + var fernTestValueRevision *string // Act - obj.SetCreatedBy(fernTestValueCreatedBy) + obj.SetRevision(fernTestValueRevision) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8454,52 +10331,52 @@ func TestSettersMarkExplicitDocumentsList200ResponseDocumentsItem(t *testing.T) } -func TestSettersDocumentsUploadProxy200Response(t *testing.T) { - t.Run("SetSha256", func(t *testing.T) { - obj := &DocumentsUploadProxy200Response{} - var fernTestValueSha256 string - obj.SetSha256(fernTestValueSha256) - assert.Equal(t, fernTestValueSha256, obj.Sha256) +func TestSettersDocumentsImportFromRequestSourceURL(t *testing.T) { + t.Run("SetURL", func(t *testing.T) { + obj := &DocumentsImportFromRequestSourceURL{} + var fernTestValueURL string + obj.SetURL(fernTestValueURL) + assert.Equal(t, fernTestValueURL, obj.URL) assert.NotNil(t, obj.explicitFields) }) } -func TestGettersDocumentsUploadProxy200Response(t *testing.T) { - t.Run("GetSha256", func(t *testing.T) { +func TestGettersDocumentsImportFromRequestSourceURL(t *testing.T) { + t.Run("GetURL", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsUploadProxy200Response{} + obj := &DocumentsImportFromRequestSourceURL{} var expected string - obj.Sha256 = expected + obj.URL = expected // Act & Assert - assert.Equal(t, expected, obj.GetSha256(), "getter should return the property value") + assert.Equal(t, expected, obj.GetURL(), "getter should return the property value") }) - t.Run("GetSha256_NilReceiver", func(t *testing.T) { + t.Run("GetURL_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsUploadProxy200Response + var obj *DocumentsImportFromRequestSourceURL // Should not panic - getters should handle nil receiver gracefully defer func() { if r := recover(); r != nil { t.Errorf("Getter panicked on nil receiver: %v", r) } }() - _ = obj.GetSha256() // Should return zero value + _ = obj.GetURL() // Should return zero value }) } -func TestSettersMarkExplicitDocumentsUploadProxy200Response(t *testing.T) { - t.Run("SetSha256_MarksExplicit", func(t *testing.T) { +func TestSettersMarkExplicitDocumentsImportFromRequestSourceURL(t *testing.T) { + t.Run("SetURL_MarksExplicit", func(t *testing.T) { t.Parallel() // Arrange - obj := &DocumentsUploadProxy200Response{} - var fernTestValueSha256 string + obj := &DocumentsImportFromRequestSourceURL{} + var fernTestValueURL string // Act - obj.SetSha256(fernTestValueSha256) + obj.SetURL(fernTestValueURL) // Assert - object with explicitly set field can be marshaled/unmarshaled bytes, err := json.Marshal(obj) @@ -8741,6 +10618,171 @@ func TestJSONMarshalingDocumentsGet200ResponseDocument(t *testing.T) { }) } +func TestJSONMarshalingDocumentsImportFrom200Response(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom200Response{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom200Response + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom200Response + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom200Response + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom200ResponseDocument(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom200ResponseDocument{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom200ResponseDocument + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom200ResponseDocument + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom200ResponseDocument + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFromRequestExpected(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestExpected{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFromRequestExpected + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFromRequestExpected + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFromRequestExpected + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFromRequestSourceConnection(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestSourceConnection{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFromRequestSourceConnection + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFromRequestSourceConnection + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFromRequestSourceConnection + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFromRequestSourceURL(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFromRequestSourceURL{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFromRequestSourceURL + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFromRequestSourceURL + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFromRequestSourceURL + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingDocumentsInit200ResponseCreated(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -9221,80 +11263,160 @@ func TestJSONMarshalingDocumentsUploadProxy200Response(t *testing.T) { assert.NoError(t, err, "round-trip unmarshal should succeed") }) - t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsUploadProxy200Response + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsUploadProxy200Response + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestStringDocumentsCommit200Response(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsCommit200Response{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200Response + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsCommit200ResponseDocument(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsCommit200ResponseDocument{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsCommit200ResponseDocument + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsGet200Response(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsGet200Response{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsGet200Response + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsGet200ResponseDocument(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsGet200ResponseDocument{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsGet200ResponseDocument + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom200Response(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { t.Parallel() - var obj DocumentsUploadProxy200Response - err := json.Unmarshal([]byte(`{invalid json}`), &obj) - assert.Error(t, err, "unmarshaling invalid JSON should return an error") + obj := &DocumentsImportFrom200Response{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") }) - t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj DocumentsUploadProxy200Response - err := json.Unmarshal([]byte(`{}`), &obj) - assert.NoError(t, err, "unmarshaling empty object should succeed") + var obj *DocumentsImportFrom200Response + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringDocumentsCommit200Response(t *testing.T) { +func TestStringDocumentsImportFrom200ResponseDocument(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &DocumentsCommit200Response{} + obj := &DocumentsImportFrom200ResponseDocument{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsCommit200Response + var obj *DocumentsImportFrom200ResponseDocument result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringDocumentsCommit200ResponseDocument(t *testing.T) { +func TestStringDocumentsImportFromRequestExpected(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &DocumentsCommit200ResponseDocument{} + obj := &DocumentsImportFromRequestExpected{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsCommit200ResponseDocument + var obj *DocumentsImportFromRequestExpected result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringDocumentsGet200Response(t *testing.T) { +func TestStringDocumentsImportFromRequestSourceConnection(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &DocumentsGet200Response{} + obj := &DocumentsImportFromRequestSourceConnection{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsGet200Response + var obj *DocumentsImportFromRequestSourceConnection result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) } -func TestStringDocumentsGet200ResponseDocument(t *testing.T) { +func TestStringDocumentsImportFromRequestSourceURL(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() - obj := &DocumentsGet200ResponseDocument{} + obj := &DocumentsImportFromRequestSourceURL{} result := obj.String() assert.NotEmpty(t, result, "String() should return a non-empty representation") }) t.Run("StringMethod_NilReceiver", func(t *testing.T) { t.Parallel() - var obj *DocumentsGet200ResponseDocument + var obj *DocumentsImportFromRequestSourceURL result := obj.String() assert.Equal(t, "", result, "String() should return for nil receiver") }) @@ -9712,6 +11834,186 @@ func TestEnumDocumentsGet200ResponseDocumentThumbnailState(t *testing.T) { }) } +func TestEnumDocumentsImportFrom200ResponseDocumentState(t *testing.T) { + t.Run("NewFromString_pending", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentStateFromString("pending") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentState("pending"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_ready", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentStateFromString("ready") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentState("ready"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_failed", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentStateFromString("failed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentState("failed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_deleting", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentStateFromString("deleting") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentState("deleting"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFrom200ResponseDocumentStateFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFrom200ResponseDocumentStateFromString("pending") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumDocumentsImportFrom200ResponseDocumentThumbnailState(t *testing.T) { + t.Run("NewFromString_pending", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentThumbnailStateFromString("pending") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentThumbnailState("pending"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_ready", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentThumbnailStateFromString("ready") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentThumbnailState("ready"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_locked", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentThumbnailStateFromString("locked") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentThumbnailState("locked"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_failed", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseDocumentThumbnailStateFromString("failed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseDocumentThumbnailState("failed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFrom200ResponseDocumentThumbnailStateFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFrom200ResponseDocumentThumbnailStateFromString("pending") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumDocumentsImportFrom200ResponseTag(t *testing.T) { + t.Run("NewFromString_imported", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseTagFromString("imported") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseTag("imported"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_deduped", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseTagFromString("deduped") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseTag("deduped"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_accepted", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom200ResponseTagFromString("accepted") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom200ResponseTag("accepted"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFrom200ResponseTagFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFrom200ResponseTagFromString("imported") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumDocumentsImportFromRequestDedupMode(t *testing.T) { + t.Run("NewFromString_always_create", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFromRequestDedupModeFromString("always-create") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFromRequestDedupMode("always-create"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_reuse_existing", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFromRequestDedupModeFromString("reuse-existing") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFromRequestDedupMode("reuse-existing"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFromRequestDedupModeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFromRequestDedupModeFromString("always-create") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumDocumentsImportFromRequestMode(t *testing.T) { + t.Run("NewFromString_sync", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFromRequestModeFromString("sync") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFromRequestMode("sync"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_async", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFromRequestModeFromString("async") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFromRequestMode("async"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFromRequestModeFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFromRequestModeFromString("sync") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumDocumentsInit200ResponseCreatedDocumentState(t *testing.T) { t.Run("NewFromString_pending", func(t *testing.T) { t.Parallel() @@ -10300,6 +12602,121 @@ func TestExtraPropertiesDocumentsGet200ResponseDocument(t *testing.T) { }) } +func TestExtraPropertiesDocumentsImportFrom200Response(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom200Response{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom200Response + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom200ResponseDocument(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom200ResponseDocument{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom200ResponseDocument + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFromRequestExpected(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFromRequestExpected{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestExpected + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFromRequestSourceConnection(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFromRequestSourceConnection{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSourceConnection + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFromRequestSourceURL(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFromRequestSourceURL{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFromRequestSourceURL + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesDocumentsInit200ResponseCreated(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() diff --git a/error_codes.go b/error_codes.go index c6a3fdf..9974716 100644 --- a/error_codes.go +++ b/error_codes.go @@ -38,4 +38,9 @@ var ErrorCodes internal.ErrorCodes = internal.ErrorCodes{ APIError: apiError, } }, + 502: func(apiError *core.APIError) error { + return &BadGatewayError{ + APIError: apiError, + } + }, } diff --git a/errors.go b/errors.go index 3622c52..42719ca 100644 --- a/errors.go +++ b/errors.go @@ -7,6 +7,30 @@ import ( core "github.com/embedpdf/cloudpdf-sdk-go/v3/core" ) +// Response +type BadGatewayError struct { + *core.APIError + Body *DocumentsImportFrom502Response +} + +func (b *BadGatewayError) UnmarshalJSON(data []byte) error { + var body *DocumentsImportFrom502Response + if err := json.Unmarshal(data, &body); err != nil { + return err + } + b.StatusCode = 502 + b.Body = body + return nil +} + +func (b *BadGatewayError) MarshalJSON() ([]byte, error) { + return json.Marshal(b.Body) +} + +func (b *BadGatewayError) Unwrap() error { + return b.APIError +} + // Bad request type BadRequestError struct { *core.APIError diff --git a/reference.md b/reference.md index 3d09419..57dfabc 100644 --- a/reference.md +++ b/reference.md @@ -1656,6 +1656,127 @@ client.Documents.UploadProxy( + + + + +
client.Documents.ImportFrom(TenantID, request) -> *cloudpdf.DocumentsImportFrom200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &cloudpdf.DocumentsImportFromRequest{ + TenantID: "tenantId", + Source: &cloudpdf.DocumentsImportFromRequestSource{ + URL: &cloudpdf.DocumentsImportFromRequestSourceURL{ + URL: "url", + }, + }, +} +client.Documents.ImportFrom( + context.TODO(), + request, +) +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantID:** `string` + +
+
+ +
+
+ +**source:** `*cloudpdf.DocumentsImportFromRequestSource` + +
+
+ +
+
+ +**expected:** `*cloudpdf.DocumentsImportFromRequestExpected` + +
+
+ +
+
+ +**metadata:** `map[string]any` + +
+
+ +
+
+ +**idempotencyKey:** `*string` + +
+
+ +
+
+ +**dedupMode:** `*cloudpdf.DocumentsImportFromRequestDedupMode` + +
+
+ +
+
+ +**docID:** `*string` + +
+
+ +
+
+ +**mode:** `*cloudpdf.DocumentsImportFromRequestMode` + +
+
+
+
+ +
diff --git a/types.go b/types.go index c355b94..35239a5 100644 --- a/types.go +++ b/types.go @@ -179910,6 +179910,1015 @@ func (d *DocumentsGet404ResponseError) String() string { return fmt.Sprintf("%#v", d) } +var ( + documentsImportFrom202ResponseFieldTag = big.NewInt(1 << 0) + documentsImportFrom202ResponseFieldDocument = big.NewInt(1 << 1) +) + +type DocumentsImportFrom202Response struct { + Tag DocumentsImportFrom202ResponseTag `json:"tag" url:"tag"` + Document *DocumentsImportFrom202ResponseDocument `json:"document" url:"document"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom202Response) GetTag() DocumentsImportFrom202ResponseTag { + if d == nil { + return "" + } + return d.Tag +} + +func (d *DocumentsImportFrom202Response) GetDocument() *DocumentsImportFrom202ResponseDocument { + if d == nil { + return nil + } + return d.Document +} + +func (d *DocumentsImportFrom202Response) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom202Response) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetTag sets the Tag field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202Response) SetTag(tag DocumentsImportFrom202ResponseTag) { + d.Tag = tag + d.require(documentsImportFrom202ResponseFieldTag) +} + +// SetDocument sets the Document field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202Response) SetDocument(document *DocumentsImportFrom202ResponseDocument) { + d.Document = document + d.require(documentsImportFrom202ResponseFieldDocument) +} + +func (d *DocumentsImportFrom202Response) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom202Response + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom202Response(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom202Response) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom202Response + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom202Response) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +var ( + documentsImportFrom202ResponseDocumentFieldID = big.NewInt(1 << 0) + documentsImportFrom202ResponseDocumentFieldTenantID = big.NewInt(1 << 1) + documentsImportFrom202ResponseDocumentFieldState = big.NewInt(1 << 2) + documentsImportFrom202ResponseDocumentFieldBaseSha = big.NewInt(1 << 3) + documentsImportFrom202ResponseDocumentFieldStorageSizeBytes = big.NewInt(1 << 4) + documentsImportFrom202ResponseDocumentFieldMetadata = big.NewInt(1 << 5) + documentsImportFrom202ResponseDocumentFieldIdempotencyKey = big.NewInt(1 << 6) + documentsImportFrom202ResponseDocumentFieldFailureReason = big.NewInt(1 << 7) + documentsImportFrom202ResponseDocumentFieldThumbnailState = big.NewInt(1 << 8) + documentsImportFrom202ResponseDocumentFieldThumbnailURL = big.NewInt(1 << 9) + documentsImportFrom202ResponseDocumentFieldCreatedAt = big.NewInt(1 << 10) + documentsImportFrom202ResponseDocumentFieldUpdatedAt = big.NewInt(1 << 11) + documentsImportFrom202ResponseDocumentFieldCreatedBy = big.NewInt(1 << 12) +) + +type DocumentsImportFrom202ResponseDocument struct { + ID string `json:"id" url:"id"` + TenantID string `json:"tenantId" url:"tenantId"` + State DocumentsImportFrom202ResponseDocumentState `json:"state" url:"state"` + BaseSha *string `json:"baseSha,omitempty" url:"baseSha,omitempty"` + StorageSizeBytes *float64 `json:"storageSizeBytes,omitempty" url:"storageSizeBytes,omitempty"` + Metadata map[string]any `json:"metadata,omitempty" url:"metadata,omitempty"` + IdempotencyKey *string `json:"idempotencyKey,omitempty" url:"idempotencyKey,omitempty"` + FailureReason *string `json:"failureReason,omitempty" url:"failureReason,omitempty"` + ThumbnailState *DocumentsImportFrom202ResponseDocumentThumbnailState `json:"thumbnailState,omitempty" url:"thumbnailState,omitempty"` + ThumbnailURL *string `json:"thumbnailUrl,omitempty" url:"thumbnailUrl,omitempty"` + CreatedAt float64 `json:"createdAt" url:"createdAt"` + UpdatedAt float64 `json:"updatedAt" url:"updatedAt"` + CreatedBy *string `json:"createdBy,omitempty" url:"createdBy,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom202ResponseDocument) GetID() string { + if d == nil { + return "" + } + return d.ID +} + +func (d *DocumentsImportFrom202ResponseDocument) GetTenantID() string { + if d == nil { + return "" + } + return d.TenantID +} + +func (d *DocumentsImportFrom202ResponseDocument) GetState() DocumentsImportFrom202ResponseDocumentState { + if d == nil { + return "" + } + return d.State +} + +func (d *DocumentsImportFrom202ResponseDocument) GetBaseSha() *string { + if d == nil { + return nil + } + return d.BaseSha +} + +func (d *DocumentsImportFrom202ResponseDocument) GetStorageSizeBytes() *float64 { + if d == nil { + return nil + } + return d.StorageSizeBytes +} + +func (d *DocumentsImportFrom202ResponseDocument) GetMetadata() map[string]any { + if d == nil { + return nil + } + return d.Metadata +} + +func (d *DocumentsImportFrom202ResponseDocument) GetIdempotencyKey() *string { + if d == nil { + return nil + } + return d.IdempotencyKey +} + +func (d *DocumentsImportFrom202ResponseDocument) GetFailureReason() *string { + if d == nil { + return nil + } + return d.FailureReason +} + +func (d *DocumentsImportFrom202ResponseDocument) GetThumbnailState() *DocumentsImportFrom202ResponseDocumentThumbnailState { + if d == nil { + return nil + } + return d.ThumbnailState +} + +func (d *DocumentsImportFrom202ResponseDocument) GetThumbnailURL() *string { + if d == nil { + return nil + } + return d.ThumbnailURL +} + +func (d *DocumentsImportFrom202ResponseDocument) GetCreatedAt() float64 { + if d == nil { + return 0 + } + return d.CreatedAt +} + +func (d *DocumentsImportFrom202ResponseDocument) GetUpdatedAt() float64 { + if d == nil { + return 0 + } + return d.UpdatedAt +} + +func (d *DocumentsImportFrom202ResponseDocument) GetCreatedBy() *string { + if d == nil { + return nil + } + return d.CreatedBy +} + +func (d *DocumentsImportFrom202ResponseDocument) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom202ResponseDocument) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetID sets the ID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetID(id string) { + d.ID = id + d.require(documentsImportFrom202ResponseDocumentFieldID) +} + +// SetTenantID sets the TenantID field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetTenantID(tenantID string) { + d.TenantID = tenantID + d.require(documentsImportFrom202ResponseDocumentFieldTenantID) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetState(state DocumentsImportFrom202ResponseDocumentState) { + d.State = state + d.require(documentsImportFrom202ResponseDocumentFieldState) +} + +// SetBaseSha sets the BaseSha field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetBaseSha(baseSha *string) { + d.BaseSha = baseSha + d.require(documentsImportFrom202ResponseDocumentFieldBaseSha) +} + +// SetStorageSizeBytes sets the StorageSizeBytes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetStorageSizeBytes(storageSizeBytes *float64) { + d.StorageSizeBytes = storageSizeBytes + d.require(documentsImportFrom202ResponseDocumentFieldStorageSizeBytes) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetMetadata(metadata map[string]any) { + d.Metadata = metadata + d.require(documentsImportFrom202ResponseDocumentFieldMetadata) +} + +// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetIdempotencyKey(idempotencyKey *string) { + d.IdempotencyKey = idempotencyKey + d.require(documentsImportFrom202ResponseDocumentFieldIdempotencyKey) +} + +// SetFailureReason sets the FailureReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetFailureReason(failureReason *string) { + d.FailureReason = failureReason + d.require(documentsImportFrom202ResponseDocumentFieldFailureReason) +} + +// SetThumbnailState sets the ThumbnailState field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetThumbnailState(thumbnailState *DocumentsImportFrom202ResponseDocumentThumbnailState) { + d.ThumbnailState = thumbnailState + d.require(documentsImportFrom202ResponseDocumentFieldThumbnailState) +} + +// SetThumbnailURL sets the ThumbnailURL field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetThumbnailURL(thumbnailURL *string) { + d.ThumbnailURL = thumbnailURL + d.require(documentsImportFrom202ResponseDocumentFieldThumbnailURL) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetCreatedAt(createdAt float64) { + d.CreatedAt = createdAt + d.require(documentsImportFrom202ResponseDocumentFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetUpdatedAt(updatedAt float64) { + d.UpdatedAt = updatedAt + d.require(documentsImportFrom202ResponseDocumentFieldUpdatedAt) +} + +// SetCreatedBy sets the CreatedBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom202ResponseDocument) SetCreatedBy(createdBy *string) { + d.CreatedBy = createdBy + d.require(documentsImportFrom202ResponseDocumentFieldCreatedBy) +} + +func (d *DocumentsImportFrom202ResponseDocument) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom202ResponseDocument + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom202ResponseDocument(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom202ResponseDocument) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom202ResponseDocument + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom202ResponseDocument) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +type DocumentsImportFrom202ResponseDocumentState string + +const ( + DocumentsImportFrom202ResponseDocumentStatePending DocumentsImportFrom202ResponseDocumentState = "pending" + DocumentsImportFrom202ResponseDocumentStateReady DocumentsImportFrom202ResponseDocumentState = "ready" + DocumentsImportFrom202ResponseDocumentStateFailed DocumentsImportFrom202ResponseDocumentState = "failed" + DocumentsImportFrom202ResponseDocumentStateDeleting DocumentsImportFrom202ResponseDocumentState = "deleting" +) + +func NewDocumentsImportFrom202ResponseDocumentStateFromString(s string) (DocumentsImportFrom202ResponseDocumentState, error) { + switch s { + case "pending": + return DocumentsImportFrom202ResponseDocumentStatePending, nil + case "ready": + return DocumentsImportFrom202ResponseDocumentStateReady, nil + case "failed": + return DocumentsImportFrom202ResponseDocumentStateFailed, nil + case "deleting": + return DocumentsImportFrom202ResponseDocumentStateDeleting, nil + } + var t DocumentsImportFrom202ResponseDocumentState + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsImportFrom202ResponseDocumentState) Ptr() *DocumentsImportFrom202ResponseDocumentState { + return &d +} + +type DocumentsImportFrom202ResponseDocumentThumbnailState string + +const ( + DocumentsImportFrom202ResponseDocumentThumbnailStatePending DocumentsImportFrom202ResponseDocumentThumbnailState = "pending" + DocumentsImportFrom202ResponseDocumentThumbnailStateReady DocumentsImportFrom202ResponseDocumentThumbnailState = "ready" + DocumentsImportFrom202ResponseDocumentThumbnailStateLocked DocumentsImportFrom202ResponseDocumentThumbnailState = "locked" + DocumentsImportFrom202ResponseDocumentThumbnailStateFailed DocumentsImportFrom202ResponseDocumentThumbnailState = "failed" +) + +func NewDocumentsImportFrom202ResponseDocumentThumbnailStateFromString(s string) (DocumentsImportFrom202ResponseDocumentThumbnailState, error) { + switch s { + case "pending": + return DocumentsImportFrom202ResponseDocumentThumbnailStatePending, nil + case "ready": + return DocumentsImportFrom202ResponseDocumentThumbnailStateReady, nil + case "locked": + return DocumentsImportFrom202ResponseDocumentThumbnailStateLocked, nil + case "failed": + return DocumentsImportFrom202ResponseDocumentThumbnailStateFailed, nil + } + var t DocumentsImportFrom202ResponseDocumentThumbnailState + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsImportFrom202ResponseDocumentThumbnailState) Ptr() *DocumentsImportFrom202ResponseDocumentThumbnailState { + return &d +} + +type DocumentsImportFrom202ResponseTag string + +const ( + DocumentsImportFrom202ResponseTagImported DocumentsImportFrom202ResponseTag = "imported" + DocumentsImportFrom202ResponseTagDeduped DocumentsImportFrom202ResponseTag = "deduped" + DocumentsImportFrom202ResponseTagAccepted DocumentsImportFrom202ResponseTag = "accepted" +) + +func NewDocumentsImportFrom202ResponseTagFromString(s string) (DocumentsImportFrom202ResponseTag, error) { + switch s { + case "imported": + return DocumentsImportFrom202ResponseTagImported, nil + case "deduped": + return DocumentsImportFrom202ResponseTagDeduped, nil + case "accepted": + return DocumentsImportFrom202ResponseTagAccepted, nil + } + var t DocumentsImportFrom202ResponseTag + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DocumentsImportFrom202ResponseTag) Ptr() *DocumentsImportFrom202ResponseTag { + return &d +} + +var ( + documentsImportFrom400ResponseFieldError = big.NewInt(1 << 0) +) + +type DocumentsImportFrom400Response struct { + Error *DocumentsImportFrom400ResponseError `json:"error" url:"error"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom400Response) GetError() *DocumentsImportFrom400ResponseError { + if d == nil { + return nil + } + return d.Error +} + +func (d *DocumentsImportFrom400Response) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom400Response) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetError sets the Error field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom400Response) SetError(error_ *DocumentsImportFrom400ResponseError) { + d.Error = error_ + d.require(documentsImportFrom400ResponseFieldError) +} + +func (d *DocumentsImportFrom400Response) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom400Response + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom400Response(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom400Response) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom400Response + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom400Response) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +var ( + documentsImportFrom400ResponseErrorFieldCode = big.NewInt(1 << 0) + documentsImportFrom400ResponseErrorFieldMessage = big.NewInt(1 << 1) +) + +type DocumentsImportFrom400ResponseError struct { + Code string `json:"code" url:"code"` + Message string `json:"message" url:"message"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom400ResponseError) GetCode() string { + if d == nil { + return "" + } + return d.Code +} + +func (d *DocumentsImportFrom400ResponseError) GetMessage() string { + if d == nil { + return "" + } + return d.Message +} + +func (d *DocumentsImportFrom400ResponseError) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom400ResponseError) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetCode sets the Code field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom400ResponseError) SetCode(code string) { + d.Code = code + d.require(documentsImportFrom400ResponseErrorFieldCode) +} + +// SetMessage sets the Message field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom400ResponseError) SetMessage(message string) { + d.Message = message + d.require(documentsImportFrom400ResponseErrorFieldMessage) +} + +func (d *DocumentsImportFrom400ResponseError) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom400ResponseError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom400ResponseError(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom400ResponseError) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom400ResponseError + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom400ResponseError) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +var ( + documentsImportFrom403ResponseFieldError = big.NewInt(1 << 0) +) + +type DocumentsImportFrom403Response struct { + Error *DocumentsImportFrom403ResponseError `json:"error" url:"error"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom403Response) GetError() *DocumentsImportFrom403ResponseError { + if d == nil { + return nil + } + return d.Error +} + +func (d *DocumentsImportFrom403Response) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom403Response) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetError sets the Error field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom403Response) SetError(error_ *DocumentsImportFrom403ResponseError) { + d.Error = error_ + d.require(documentsImportFrom403ResponseFieldError) +} + +func (d *DocumentsImportFrom403Response) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom403Response + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom403Response(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom403Response) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom403Response + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom403Response) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +var ( + documentsImportFrom403ResponseErrorFieldCode = big.NewInt(1 << 0) + documentsImportFrom403ResponseErrorFieldMessage = big.NewInt(1 << 1) +) + +type DocumentsImportFrom403ResponseError struct { + Code string `json:"code" url:"code"` + Message string `json:"message" url:"message"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom403ResponseError) GetCode() string { + if d == nil { + return "" + } + return d.Code +} + +func (d *DocumentsImportFrom403ResponseError) GetMessage() string { + if d == nil { + return "" + } + return d.Message +} + +func (d *DocumentsImportFrom403ResponseError) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom403ResponseError) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetCode sets the Code field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom403ResponseError) SetCode(code string) { + d.Code = code + d.require(documentsImportFrom403ResponseErrorFieldCode) +} + +// SetMessage sets the Message field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom403ResponseError) SetMessage(message string) { + d.Message = message + d.require(documentsImportFrom403ResponseErrorFieldMessage) +} + +func (d *DocumentsImportFrom403ResponseError) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom403ResponseError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom403ResponseError(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom403ResponseError) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom403ResponseError + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom403ResponseError) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +var ( + documentsImportFrom502ResponseFieldError = big.NewInt(1 << 0) +) + +type DocumentsImportFrom502Response struct { + Error *DocumentsImportFrom502ResponseError `json:"error" url:"error"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom502Response) GetError() *DocumentsImportFrom502ResponseError { + if d == nil { + return nil + } + return d.Error +} + +func (d *DocumentsImportFrom502Response) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom502Response) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetError sets the Error field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom502Response) SetError(error_ *DocumentsImportFrom502ResponseError) { + d.Error = error_ + d.require(documentsImportFrom502ResponseFieldError) +} + +func (d *DocumentsImportFrom502Response) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom502Response + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom502Response(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom502Response) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom502Response + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom502Response) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +var ( + documentsImportFrom502ResponseErrorFieldCode = big.NewInt(1 << 0) + documentsImportFrom502ResponseErrorFieldMessage = big.NewInt(1 << 1) +) + +type DocumentsImportFrom502ResponseError struct { + Code string `json:"code" url:"code"` + Message string `json:"message" url:"message"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DocumentsImportFrom502ResponseError) GetCode() string { + if d == nil { + return "" + } + return d.Code +} + +func (d *DocumentsImportFrom502ResponseError) GetMessage() string { + if d == nil { + return "" + } + return d.Message +} + +func (d *DocumentsImportFrom502ResponseError) GetExtraProperties() map[string]interface{} { + if d == nil { + return nil + } + return d.extraProperties +} + +func (d *DocumentsImportFrom502ResponseError) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetCode sets the Code field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom502ResponseError) SetCode(code string) { + d.Code = code + d.require(documentsImportFrom502ResponseErrorFieldCode) +} + +// SetMessage sets the Message field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DocumentsImportFrom502ResponseError) SetMessage(message string) { + d.Message = message + d.require(documentsImportFrom502ResponseErrorFieldMessage) +} + +func (d *DocumentsImportFrom502ResponseError) UnmarshalJSON(data []byte) error { + type unmarshaler DocumentsImportFrom502ResponseError + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DocumentsImportFrom502ResponseError(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DocumentsImportFrom502ResponseError) MarshalJSON() ([]byte, error) { + type embed DocumentsImportFrom502ResponseError + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DocumentsImportFrom502ResponseError) String() string { + if d == nil { + return "" + } + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + var ( documentsInit400ResponseFieldError = big.NewInt(1 << 0) ) diff --git a/types_test.go b/types_test.go index 2a20944..148ed1b 100644 --- a/types_test.go +++ b/types_test.go @@ -292126,6 +292126,1686 @@ func TestSettersMarkExplicitDocumentsGet404ResponseError(t *testing.T) { } +func TestSettersDocumentsImportFrom202Response(t *testing.T) { + t.Run("SetTag", func(t *testing.T) { + obj := &DocumentsImportFrom202Response{} + var fernTestValueTag DocumentsImportFrom202ResponseTag + obj.SetTag(fernTestValueTag) + assert.Equal(t, fernTestValueTag, obj.Tag) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDocument", func(t *testing.T) { + obj := &DocumentsImportFrom202Response{} + var fernTestValueDocument *DocumentsImportFrom202ResponseDocument + obj.SetDocument(fernTestValueDocument) + assert.Equal(t, fernTestValueDocument, obj.Document) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom202Response(t *testing.T) { + t.Run("GetTag", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202Response{} + var expected DocumentsImportFrom202ResponseTag + obj.Tag = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTag(), "getter should return the property value") + }) + + t.Run("GetTag_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTag() // Should return zero value + }) + + t.Run("GetDocument", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202Response{} + var expected *DocumentsImportFrom202ResponseDocument + obj.Document = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDocument(), "getter should return the property value") + }) + + t.Run("GetDocument_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202Response{} + obj.Document = nil + + // Act & Assert + assert.Nil(t, obj.GetDocument(), "getter should return nil when property is nil") + }) + + t.Run("GetDocument_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDocument() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom202Response(t *testing.T) { + t.Run("SetTag_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202Response{} + var fernTestValueTag DocumentsImportFrom202ResponseTag + + // Act + obj.SetTag(fernTestValueTag) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDocument_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202Response{} + var fernTestValueDocument *DocumentsImportFrom202ResponseDocument + + // Act + obj.SetDocument(fernTestValueDocument) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFrom202ResponseDocument(t *testing.T) { + t.Run("SetID", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueID string + obj.SetID(fernTestValueID) + assert.Equal(t, fernTestValueID, obj.ID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetTenantID", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueTenantID string + obj.SetTenantID(fernTestValueTenantID) + assert.Equal(t, fernTestValueTenantID, obj.TenantID) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetState", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueState DocumentsImportFrom202ResponseDocumentState + obj.SetState(fernTestValueState) + assert.Equal(t, fernTestValueState, obj.State) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetBaseSha", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueBaseSha *string + obj.SetBaseSha(fernTestValueBaseSha) + assert.Equal(t, fernTestValueBaseSha, obj.BaseSha) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetStorageSizeBytes", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueStorageSizeBytes *float64 + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + assert.Equal(t, fernTestValueStorageSizeBytes, obj.StorageSizeBytes) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMetadata", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueMetadata map[string]any + obj.SetMetadata(fernTestValueMetadata) + assert.Equal(t, fernTestValueMetadata, obj.Metadata) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetIdempotencyKey", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueIdempotencyKey *string + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + assert.Equal(t, fernTestValueIdempotencyKey, obj.IdempotencyKey) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetFailureReason", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueFailureReason *string + obj.SetFailureReason(fernTestValueFailureReason) + assert.Equal(t, fernTestValueFailureReason, obj.FailureReason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetThumbnailState", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueThumbnailState *DocumentsImportFrom202ResponseDocumentThumbnailState + obj.SetThumbnailState(fernTestValueThumbnailState) + assert.Equal(t, fernTestValueThumbnailState, obj.ThumbnailState) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetThumbnailURL", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueThumbnailURL *string + obj.SetThumbnailURL(fernTestValueThumbnailURL) + assert.Equal(t, fernTestValueThumbnailURL, obj.ThumbnailURL) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedAt", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueCreatedAt float64 + obj.SetCreatedAt(fernTestValueCreatedAt) + assert.Equal(t, fernTestValueCreatedAt, obj.CreatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetUpdatedAt", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueUpdatedAt float64 + obj.SetUpdatedAt(fernTestValueUpdatedAt) + assert.Equal(t, fernTestValueUpdatedAt, obj.UpdatedAt) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetCreatedBy", func(t *testing.T) { + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueCreatedBy *string + obj.SetCreatedBy(fernTestValueCreatedBy) + assert.Equal(t, fernTestValueCreatedBy, obj.CreatedBy) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom202ResponseDocument(t *testing.T) { + t.Run("GetID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected string + obj.ID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetID(), "getter should return the property value") + }) + + t.Run("GetID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetID() // Should return zero value + }) + + t.Run("GetTenantID", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected string + obj.TenantID = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetTenantID(), "getter should return the property value") + }) + + t.Run("GetTenantID_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetTenantID() // Should return zero value + }) + + t.Run("GetState", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected DocumentsImportFrom202ResponseDocumentState + obj.State = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetState(), "getter should return the property value") + }) + + t.Run("GetState_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetState() // Should return zero value + }) + + t.Run("GetBaseSha", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected *string + obj.BaseSha = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetBaseSha(), "getter should return the property value") + }) + + t.Run("GetBaseSha_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.BaseSha = nil + + // Act & Assert + assert.Nil(t, obj.GetBaseSha(), "getter should return nil when property is nil") + }) + + t.Run("GetBaseSha_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetBaseSha() // Should return zero value + }) + + t.Run("GetStorageSizeBytes", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected *float64 + obj.StorageSizeBytes = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetStorageSizeBytes(), "getter should return the property value") + }) + + t.Run("GetStorageSizeBytes_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.StorageSizeBytes = nil + + // Act & Assert + assert.Nil(t, obj.GetStorageSizeBytes(), "getter should return nil when property is nil") + }) + + t.Run("GetStorageSizeBytes_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetStorageSizeBytes() // Should return zero value + }) + + t.Run("GetMetadata", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected map[string]any + obj.Metadata = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMetadata(), "getter should return the property value") + }) + + t.Run("GetMetadata_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.Metadata = nil + + // Act & Assert + assert.Nil(t, obj.GetMetadata(), "getter should return nil when property is nil") + }) + + t.Run("GetMetadata_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMetadata() // Should return zero value + }) + + t.Run("GetIdempotencyKey", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected *string + obj.IdempotencyKey = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetIdempotencyKey(), "getter should return the property value") + }) + + t.Run("GetIdempotencyKey_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.IdempotencyKey = nil + + // Act & Assert + assert.Nil(t, obj.GetIdempotencyKey(), "getter should return nil when property is nil") + }) + + t.Run("GetIdempotencyKey_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetIdempotencyKey() // Should return zero value + }) + + t.Run("GetFailureReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected *string + obj.FailureReason = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetFailureReason(), "getter should return the property value") + }) + + t.Run("GetFailureReason_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.FailureReason = nil + + // Act & Assert + assert.Nil(t, obj.GetFailureReason(), "getter should return nil when property is nil") + }) + + t.Run("GetFailureReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetFailureReason() // Should return zero value + }) + + t.Run("GetThumbnailState", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected *DocumentsImportFrom202ResponseDocumentThumbnailState + obj.ThumbnailState = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailState(), "getter should return the property value") + }) + + t.Run("GetThumbnailState_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.ThumbnailState = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailState(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailState_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailState() // Should return zero value + }) + + t.Run("GetThumbnailURL", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected *string + obj.ThumbnailURL = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetThumbnailURL(), "getter should return the property value") + }) + + t.Run("GetThumbnailURL_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.ThumbnailURL = nil + + // Act & Assert + assert.Nil(t, obj.GetThumbnailURL(), "getter should return nil when property is nil") + }) + + t.Run("GetThumbnailURL_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetThumbnailURL() // Should return zero value + }) + + t.Run("GetCreatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected float64 + obj.CreatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedAt(), "getter should return the property value") + }) + + t.Run("GetCreatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedAt() // Should return zero value + }) + + t.Run("GetUpdatedAt", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected float64 + obj.UpdatedAt = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetUpdatedAt(), "getter should return the property value") + }) + + t.Run("GetUpdatedAt_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetUpdatedAt() // Should return zero value + }) + + t.Run("GetCreatedBy", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var expected *string + obj.CreatedBy = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCreatedBy(), "getter should return the property value") + }) + + t.Run("GetCreatedBy_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + obj.CreatedBy = nil + + // Act & Assert + assert.Nil(t, obj.GetCreatedBy(), "getter should return nil when property is nil") + }) + + t.Run("GetCreatedBy_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCreatedBy() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom202ResponseDocument(t *testing.T) { + t.Run("SetID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueID string + + // Act + obj.SetID(fernTestValueID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetTenantID_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueTenantID string + + // Act + obj.SetTenantID(fernTestValueTenantID) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetState_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueState DocumentsImportFrom202ResponseDocumentState + + // Act + obj.SetState(fernTestValueState) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetBaseSha_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueBaseSha *string + + // Act + obj.SetBaseSha(fernTestValueBaseSha) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetStorageSizeBytes_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueStorageSizeBytes *float64 + + // Act + obj.SetStorageSizeBytes(fernTestValueStorageSizeBytes) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMetadata_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueMetadata map[string]any + + // Act + obj.SetMetadata(fernTestValueMetadata) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetIdempotencyKey_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueIdempotencyKey *string + + // Act + obj.SetIdempotencyKey(fernTestValueIdempotencyKey) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetFailureReason_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueFailureReason *string + + // Act + obj.SetFailureReason(fernTestValueFailureReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetThumbnailState_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueThumbnailState *DocumentsImportFrom202ResponseDocumentThumbnailState + + // Act + obj.SetThumbnailState(fernTestValueThumbnailState) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetThumbnailURL_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueThumbnailURL *string + + // Act + obj.SetThumbnailURL(fernTestValueThumbnailURL) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueCreatedAt float64 + + // Act + obj.SetCreatedAt(fernTestValueCreatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetUpdatedAt_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueUpdatedAt float64 + + // Act + obj.SetUpdatedAt(fernTestValueUpdatedAt) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetCreatedBy_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + var fernTestValueCreatedBy *string + + // Act + obj.SetCreatedBy(fernTestValueCreatedBy) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFrom400Response(t *testing.T) { + t.Run("SetError", func(t *testing.T) { + obj := &DocumentsImportFrom400Response{} + var fernTestValueError *DocumentsImportFrom400ResponseError + obj.SetError(fernTestValueError) + assert.Equal(t, fernTestValueError, obj.Error) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom400Response(t *testing.T) { + t.Run("GetError", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400Response{} + var expected *DocumentsImportFrom400ResponseError + obj.Error = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetError(), "getter should return the property value") + }) + + t.Run("GetError_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400Response{} + obj.Error = nil + + // Act & Assert + assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + }) + + t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom400Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetError() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom400Response(t *testing.T) { + t.Run("SetError_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400Response{} + var fernTestValueError *DocumentsImportFrom400ResponseError + + // Act + obj.SetError(fernTestValueError) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFrom400ResponseError(t *testing.T) { + t.Run("SetCode", func(t *testing.T) { + obj := &DocumentsImportFrom400ResponseError{} + var fernTestValueCode string + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessage", func(t *testing.T) { + obj := &DocumentsImportFrom400ResponseError{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom400ResponseError(t *testing.T) { + t.Run("GetCode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400ResponseError{} + var expected string + obj.Code = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") + }) + + t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom400ResponseError + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCode() // Should return zero value + }) + + t.Run("GetMessage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400ResponseError{} + var expected string + obj.Message = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + }) + + t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom400ResponseError + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessage() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom400ResponseError(t *testing.T) { + t.Run("SetCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400ResponseError{} + var fernTestValueCode string + + // Act + obj.SetCode(fernTestValueCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400ResponseError{} + var fernTestValueMessage string + + // Act + obj.SetMessage(fernTestValueMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFrom403Response(t *testing.T) { + t.Run("SetError", func(t *testing.T) { + obj := &DocumentsImportFrom403Response{} + var fernTestValueError *DocumentsImportFrom403ResponseError + obj.SetError(fernTestValueError) + assert.Equal(t, fernTestValueError, obj.Error) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom403Response(t *testing.T) { + t.Run("GetError", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403Response{} + var expected *DocumentsImportFrom403ResponseError + obj.Error = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetError(), "getter should return the property value") + }) + + t.Run("GetError_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403Response{} + obj.Error = nil + + // Act & Assert + assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + }) + + t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom403Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetError() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom403Response(t *testing.T) { + t.Run("SetError_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403Response{} + var fernTestValueError *DocumentsImportFrom403ResponseError + + // Act + obj.SetError(fernTestValueError) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFrom403ResponseError(t *testing.T) { + t.Run("SetCode", func(t *testing.T) { + obj := &DocumentsImportFrom403ResponseError{} + var fernTestValueCode string + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessage", func(t *testing.T) { + obj := &DocumentsImportFrom403ResponseError{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom403ResponseError(t *testing.T) { + t.Run("GetCode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403ResponseError{} + var expected string + obj.Code = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") + }) + + t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom403ResponseError + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCode() // Should return zero value + }) + + t.Run("GetMessage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403ResponseError{} + var expected string + obj.Message = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + }) + + t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom403ResponseError + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessage() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom403ResponseError(t *testing.T) { + t.Run("SetCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403ResponseError{} + var fernTestValueCode string + + // Act + obj.SetCode(fernTestValueCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403ResponseError{} + var fernTestValueMessage string + + // Act + obj.SetMessage(fernTestValueMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFrom502Response(t *testing.T) { + t.Run("SetError", func(t *testing.T) { + obj := &DocumentsImportFrom502Response{} + var fernTestValueError *DocumentsImportFrom502ResponseError + obj.SetError(fernTestValueError) + assert.Equal(t, fernTestValueError, obj.Error) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom502Response(t *testing.T) { + t.Run("GetError", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502Response{} + var expected *DocumentsImportFrom502ResponseError + obj.Error = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetError(), "getter should return the property value") + }) + + t.Run("GetError_NilValue", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502Response{} + obj.Error = nil + + // Act & Assert + assert.Nil(t, obj.GetError(), "getter should return nil when property is nil") + }) + + t.Run("GetError_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom502Response + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetError() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom502Response(t *testing.T) { + t.Run("SetError_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502Response{} + var fernTestValueError *DocumentsImportFrom502ResponseError + + // Act + obj.SetError(fernTestValueError) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + +func TestSettersDocumentsImportFrom502ResponseError(t *testing.T) { + t.Run("SetCode", func(t *testing.T) { + obj := &DocumentsImportFrom502ResponseError{} + var fernTestValueCode string + obj.SetCode(fernTestValueCode) + assert.Equal(t, fernTestValueCode, obj.Code) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetMessage", func(t *testing.T) { + obj := &DocumentsImportFrom502ResponseError{} + var fernTestValueMessage string + obj.SetMessage(fernTestValueMessage) + assert.Equal(t, fernTestValueMessage, obj.Message) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersDocumentsImportFrom502ResponseError(t *testing.T) { + t.Run("GetCode", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502ResponseError{} + var expected string + obj.Code = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetCode(), "getter should return the property value") + }) + + t.Run("GetCode_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom502ResponseError + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetCode() // Should return zero value + }) + + t.Run("GetMessage", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502ResponseError{} + var expected string + obj.Message = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetMessage(), "getter should return the property value") + }) + + t.Run("GetMessage_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom502ResponseError + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetMessage() // Should return zero value + }) + +} + +func TestSettersMarkExplicitDocumentsImportFrom502ResponseError(t *testing.T) { + t.Run("SetCode_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502ResponseError{} + var fernTestValueCode string + + // Act + obj.SetCode(fernTestValueCode) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetMessage_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502ResponseError{} + var fernTestValueMessage string + + // Act + obj.SetMessage(fernTestValueMessage) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + func TestSettersDocumentsInit400Response(t *testing.T) { t.Run("SetError", func(t *testing.T) { obj := &DocumentsInit400Response{} @@ -333987,6 +335667,270 @@ func TestJSONMarshalingDocumentsGet404ResponseError(t *testing.T) { }) } +func TestJSONMarshalingDocumentsImportFrom202Response(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202Response{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom202Response + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom202Response + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom202Response + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom202ResponseDocument(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom202ResponseDocument{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom202ResponseDocument + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom202ResponseDocument + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom202ResponseDocument + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom400Response(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400Response{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom400Response + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom400Response + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom400Response + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom400ResponseError(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom400ResponseError{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom400ResponseError + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom400ResponseError + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom400ResponseError + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom403Response(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403Response{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom403Response + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom403Response + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom403Response + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom403ResponseError(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom403ResponseError{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom403ResponseError + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom403ResponseError + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom403ResponseError + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom502Response(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502Response{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom502Response + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom502Response + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom502Response + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + +func TestJSONMarshalingDocumentsImportFrom502ResponseError(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &DocumentsImportFrom502ResponseError{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled DocumentsImportFrom502ResponseError + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom502ResponseError + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj DocumentsImportFrom502ResponseError + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingDocumentsInit400Response(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -353024,6 +354968,134 @@ func TestStringDocumentsGet404ResponseError(t *testing.T) { }) } +func TestStringDocumentsImportFrom202Response(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom202Response{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202Response + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom202ResponseDocument(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom202ResponseDocument{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom400Response(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom400Response{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom400Response + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom400ResponseError(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom400ResponseError{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom400ResponseError + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom403Response(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom403Response{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom403Response + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom403ResponseError(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom403ResponseError{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom403ResponseError + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom502Response(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom502Response{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom502Response + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + +func TestStringDocumentsImportFrom502ResponseError(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom502ResponseError{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom502ResponseError + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringDocumentsInit400Response(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -408582,6 +410654,128 @@ func TestEnumDocText404ResponseName(t *testing.T) { }) } +func TestEnumDocumentsImportFrom202ResponseDocumentState(t *testing.T) { + t.Run("NewFromString_pending", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentStateFromString("pending") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentState("pending"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_ready", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentStateFromString("ready") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentState("ready"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_failed", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentStateFromString("failed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentState("failed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_deleting", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentStateFromString("deleting") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentState("deleting"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFrom202ResponseDocumentStateFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFrom202ResponseDocumentStateFromString("pending") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumDocumentsImportFrom202ResponseDocumentThumbnailState(t *testing.T) { + t.Run("NewFromString_pending", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentThumbnailStateFromString("pending") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentThumbnailState("pending"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_ready", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentThumbnailStateFromString("ready") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentThumbnailState("ready"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_locked", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentThumbnailStateFromString("locked") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentThumbnailState("locked"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_failed", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseDocumentThumbnailStateFromString("failed") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseDocumentThumbnailState("failed"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFrom202ResponseDocumentThumbnailStateFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFrom202ResponseDocumentThumbnailStateFromString("pending") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumDocumentsImportFrom202ResponseTag(t *testing.T) { + t.Run("NewFromString_imported", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseTagFromString("imported") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseTag("imported"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_deduped", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseTagFromString("deduped") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseTag("deduped"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_accepted", func(t *testing.T) { + t.Parallel() + val, err := NewDocumentsImportFrom202ResponseTagFromString("accepted") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, DocumentsImportFrom202ResponseTag("accepted"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewDocumentsImportFrom202ResponseTagFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewDocumentsImportFrom202ResponseTagFromString("imported") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumEngineErrorPayloadCode(t *testing.T) { t.Run("NewFromString_Unknown", func(t *testing.T) { t.Parallel() @@ -433224,6 +435418,190 @@ func TestExtraPropertiesDocumentsGet404ResponseError(t *testing.T) { }) } +func TestExtraPropertiesDocumentsImportFrom202Response(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom202Response{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202Response + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom202ResponseDocument(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom202ResponseDocument{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom202ResponseDocument + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom400Response(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom400Response{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom400Response + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom400ResponseError(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom400ResponseError{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom400ResponseError + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom403Response(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom403Response{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom403Response + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom403ResponseError(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom403ResponseError{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom403ResponseError + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom502Response(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom502Response{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom502Response + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + +func TestExtraPropertiesDocumentsImportFrom502ResponseError(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &DocumentsImportFrom502ResponseError{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *DocumentsImportFrom502ResponseError + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesDocumentsInit400Response(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() diff --git a/wiremock/wiremock-mappings.json b/wiremock/wiremock-mappings.json index 608a6e7..1979f95 100644 --- a/wiremock/wiremock-mappings.json +++ b/wiremock/wiremock-mappings.json @@ -958,6 +958,42 @@ } } }, + { + "id": "e83a7cad-60e3-4f29-a5b6-08de2c40c7db", + "name": "Server-side pull: fetch a PDF from a caller-supplied URL (e.g. a presigned object-store GET) or an operator-registered storage connection into CloudPDF-owned storage, verify it, and commit it. - default", + "request": { + "urlPathTemplate": "/v1/tenants/{tenantId}/documents/import", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "tenantId": { + "equalTo": "tenantId" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"tag\": \"imported\",\n \"document\": {\n \"id\": \"id\",\n \"tenantId\": \"tenantId\",\n \"state\": \"pending\",\n \"baseSha\": \"baseSha\",\n \"storageSizeBytes\": 1.1,\n \"metadata\": {\n \"key\": \"value\"\n },\n \"idempotencyKey\": \"idempotencyKey\",\n \"failureReason\": \"failureReason\",\n \"thumbnailState\": \"pending\",\n \"thumbnailUrl\": \"thumbnailUrl\",\n \"createdAt\": 1.1,\n \"updatedAt\": 1.1,\n \"createdBy\": \"createdBy\"\n }\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "e83a7cad-60e3-4f29-a5b6-08de2c40c7db", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "52722630-c23c-4ef6-9600-e4dbad2d5dda", "name": "Begin an upload: create (or resume/dedupe) a pending document and issue upload access. - default", @@ -1680,6 +1716,6 @@ } ], "meta": { - "total": 44 + "total": 45 } } \ No newline at end of file