From 1f8cc48c3ac68f95427824abcacdb3d4a6296d30 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 24 Sep 2024 14:15:36 +0000 Subject: [PATCH] Regenerate client from commit 77d3d5e5 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 120 ++++++++ .../client/v2/model/UserCreateAttributes.java | 179 +++++++++++- .../model/UserInvitationDataAttributes.java | 40 ++- .../client/v2/model/UserOrgsSerializable.java | 205 +++++++++++++ .../model/UserOrgsSerializableAttributes.java | 274 ++++++++++++++++++ .../v2/model/UserOrgsSerializableType.java | 55 ++++ .../model/UserOverrideIdentityProvider.java | 209 +++++++++++++ ...serOverrideIdentityProviderAttributes.java | 140 +++++++++ .../UserOverrideIdentityProviderType.java | 58 ++++ .../v2/model/UserResponseIncludedItem.java | 145 ++++++++- .../client/v2/model/UserUpdateAttributes.java | 190 +++++++++++- .../datadog/api/client/v2/api/users.feature | 4 +- 13 files changed, 1610 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializable.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProvider.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderType.java diff --git a/.apigentools-info b/.apigentools-info index 3928a90755a..1cede0759a9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-23 19:10:24.412445", - "spec_repo_commit": "41592dc6" + "regenerated": "2024-09-24 14:14:03.002222", + "spec_repo_commit": "77d3d5e5" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-23 19:10:24.427636", - "spec_repo_commit": "41592dc6" + "regenerated": "2024-09-24 14:14:03.016554", + "spec_repo_commit": "77d3d5e5" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ee4788c60a5..ba2e7be926a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24635,16 +24635,36 @@ components: UserCreateAttributes: description: Attributes of the created user. properties: + created_at: + description: The `UserCreateAttributes` `created_at`. + format: date-time + type: string + disabled: + description: The `UserCreateAttributes` `disabled`. + type: boolean email: description: The email of the user. example: jane.doe@example.com type: string + handle: + description: The `UserCreateAttributes` `handle`. + type: string + modified_at: + description: The `UserCreateAttributes` `modified_at`. + format: date-time + type: string name: description: The name of the user. type: string + service_account: + description: The `UserCreateAttributes` `service_account`. + type: boolean title: description: The title of the user. type: string + verified: + description: The `UserCreateAttributes` `verified`. + type: boolean required: - email type: object @@ -24694,6 +24714,10 @@ components: invite_type: description: Type of invitation. type: string + login_method: + description: The `UserInvitationDataAttributes` `login_method`. + nullable: true + type: string uuid: description: UUID of the user invitation. type: string @@ -24755,6 +24779,79 @@ components: type: string x-enum-varnames: - USER_INVITATIONS + UserOrgsSerializable: + description: The definition of `UserOrgsSerializable` object. + properties: + attributes: + $ref: '#/components/schemas/UserOrgsSerializableAttributes' + id: + description: The `UserOrgsSerializable` `id`. + type: string + type: + $ref: '#/components/schemas/UserOrgsSerializableType' + required: + - type + type: object + UserOrgsSerializableAttributes: + description: The definition of `UserOrgsSerializableAttributes` object. + properties: + disabled: + description: The `UserOrgsSerializableAttributes` `disabled`. + type: boolean + email: + description: The `UserOrgsSerializableAttributes` `email`. + type: string + name: + description: The `UserOrgsSerializableAttributes` `name`. + type: string + org_id: + description: The `UserOrgsSerializableAttributes` `org_id`. + type: string + title: + description: The `UserOrgsSerializableAttributes` `title`. + type: string + verified: + description: The `UserOrgsSerializableAttributes` `verified`. + type: boolean + type: object + UserOrgsSerializableType: + default: users + description: The definition of `UserOrgsSerializableType` object. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS + UserOverrideIdentityProvider: + description: The definition of `UserOverrideIdentityProvider` object. + properties: + attributes: + $ref: '#/components/schemas/UserOverrideIdentityProviderAttributes' + id: + description: The `UserOverrideIdentityProvider` `id`. + type: string + type: + $ref: '#/components/schemas/UserOverrideIdentityProviderType' + required: + - type + type: object + UserOverrideIdentityProviderAttributes: + description: The definition of `UserOverrideIdentityProviderAttributes` object. + properties: + authentication_method: + description: The `UserOverrideIdentityProviderAttributes` `authentication_method`. + type: string + type: object + UserOverrideIdentityProviderType: + default: identity_providers + description: The definition of `UserOverrideIdentityProviderType` object. + enum: + - identity_providers + example: identity_providers + type: string + x-enum-varnames: + - IDENTITY_PROVIDERS UserRelationshipData: description: Relationship to user object. properties: @@ -24800,6 +24897,8 @@ components: - $ref: '#/components/schemas/Organization' - $ref: '#/components/schemas/Permission' - $ref: '#/components/schemas/Role' + - $ref: '#/components/schemas/UserOverrideIdentityProvider' + - $ref: '#/components/schemas/UserOrgsSerializable' UserResponseRelationships: description: Relationships of the user object returned by the API. properties: @@ -25038,15 +25137,36 @@ components: UserUpdateAttributes: description: Attributes of the edited user. properties: + created_at: + description: The `UserUpdateAttributes` `created_at`. + format: date-time + type: string disabled: description: If the user is enabled or disabled. type: boolean email: description: The email of the user. type: string + handle: + description: The `UserUpdateAttributes` `handle`. + type: string + modified_at: + description: The `UserUpdateAttributes` `modified_at`. + format: date-time + type: string name: description: The name of the user. type: string + service_account: + description: The `UserUpdateAttributes` `service_account`. + type: boolean + title: + description: The `UserUpdateAttributes` `title`. + nullable: true + type: string + verified: + description: The `UserUpdateAttributes` `verified`. + type: boolean type: object UserUpdateData: description: Object to update a user. diff --git a/src/main/java/com/datadog/api/client/v2/model/UserCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserCreateAttributes.java index e3d308bc582..9e0f0577185 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UserCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UserCreateAttributes.java @@ -13,29 +13,54 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; /** Attributes of the created user. */ @JsonPropertyOrder({ + UserCreateAttributes.JSON_PROPERTY_CREATED_AT, + UserCreateAttributes.JSON_PROPERTY_DISABLED, UserCreateAttributes.JSON_PROPERTY_EMAIL, + UserCreateAttributes.JSON_PROPERTY_HANDLE, + UserCreateAttributes.JSON_PROPERTY_MODIFIED_AT, UserCreateAttributes.JSON_PROPERTY_NAME, - UserCreateAttributes.JSON_PROPERTY_TITLE + UserCreateAttributes.JSON_PROPERTY_SERVICE_ACCOUNT, + UserCreateAttributes.JSON_PROPERTY_TITLE, + UserCreateAttributes.JSON_PROPERTY_VERIFIED }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class UserCreateAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_DISABLED = "disabled"; + private Boolean disabled; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_SERVICE_ACCOUNT = "service_account"; + private Boolean serviceAccount; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + public static final String JSON_PROPERTY_VERIFIED = "verified"; + private Boolean verified; + public UserCreateAttributes() {} @JsonCreator @@ -44,6 +69,48 @@ public UserCreateAttributes( this.email = email; } + public UserCreateAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The UserCreateAttributes created_at. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public UserCreateAttributes disabled(Boolean disabled) { + this.disabled = disabled; + return this; + } + + /** + * The UserCreateAttributes disabled. + * + * @return disabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisabled() { + return disabled; + } + + public void setDisabled(Boolean disabled) { + this.disabled = disabled; + } + public UserCreateAttributes email(String email) { this.email = email; return this; @@ -64,6 +131,48 @@ public void setEmail(String email) { this.email = email; } + public UserCreateAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The UserCreateAttributes handle. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public UserCreateAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The UserCreateAttributes modified_at. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + public UserCreateAttributes name(String name) { this.name = name; return this; @@ -85,6 +194,27 @@ public void setName(String name) { this.name = name; } + public UserCreateAttributes serviceAccount(Boolean serviceAccount) { + this.serviceAccount = serviceAccount; + return this; + } + + /** + * The UserCreateAttributes service_account. + * + * @return serviceAccount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getServiceAccount() { + return serviceAccount; + } + + public void setServiceAccount(Boolean serviceAccount) { + this.serviceAccount = serviceAccount; + } + public UserCreateAttributes title(String title) { this.title = title; return this; @@ -106,6 +236,27 @@ public void setTitle(String title) { this.title = title; } + public UserCreateAttributes verified(Boolean verified) { + this.verified = verified; + return this; + } + + /** + * The UserCreateAttributes verified. + * + * @return verified + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVerified() { + return verified; + } + + public void setVerified(Boolean verified) { + this.verified = verified; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -162,24 +313,46 @@ public boolean equals(Object o) { return false; } UserCreateAttributes userCreateAttributes = (UserCreateAttributes) o; - return Objects.equals(this.email, userCreateAttributes.email) + return Objects.equals(this.createdAt, userCreateAttributes.createdAt) + && Objects.equals(this.disabled, userCreateAttributes.disabled) + && Objects.equals(this.email, userCreateAttributes.email) + && Objects.equals(this.handle, userCreateAttributes.handle) + && Objects.equals(this.modifiedAt, userCreateAttributes.modifiedAt) && Objects.equals(this.name, userCreateAttributes.name) + && Objects.equals(this.serviceAccount, userCreateAttributes.serviceAccount) && Objects.equals(this.title, userCreateAttributes.title) + && Objects.equals(this.verified, userCreateAttributes.verified) && Objects.equals(this.additionalProperties, userCreateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(email, name, title, additionalProperties); + return Objects.hash( + createdAt, + disabled, + email, + handle, + modifiedAt, + name, + serviceAccount, + title, + verified, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UserCreateAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" serviceAccount: ").append(toIndentedString(serviceAccount)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/UserInvitationDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserInvitationDataAttributes.java index 05799da944e..5647c811871 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UserInvitationDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UserInvitationDataAttributes.java @@ -16,12 +16,14 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** Attributes of a user invitation. */ @JsonPropertyOrder({ UserInvitationDataAttributes.JSON_PROPERTY_CREATED_AT, UserInvitationDataAttributes.JSON_PROPERTY_EXPIRES_AT, UserInvitationDataAttributes.JSON_PROPERTY_INVITE_TYPE, + UserInvitationDataAttributes.JSON_PROPERTY_LOGIN_METHOD, UserInvitationDataAttributes.JSON_PROPERTY_UUID }) @jakarta.annotation.Generated( @@ -37,6 +39,9 @@ public class UserInvitationDataAttributes { public static final String JSON_PROPERTY_INVITE_TYPE = "invite_type"; private String inviteType; + public static final String JSON_PROPERTY_LOGIN_METHOD = "login_method"; + private JsonNullable loginMethod = JsonNullable.undefined(); + public static final String JSON_PROPERTY_UUID = "uuid"; private String uuid; @@ -103,6 +108,37 @@ public void setInviteType(String inviteType) { this.inviteType = inviteType; } + public UserInvitationDataAttributes loginMethod(String loginMethod) { + this.loginMethod = JsonNullable.of(loginMethod); + return this; + } + + /** + * The UserInvitationDataAttributes login_method. + * + * @return loginMethod + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getLoginMethod() { + return loginMethod.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LOGIN_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLoginMethod_JsonNullable() { + return loginMethod; + } + + @JsonProperty(JSON_PROPERTY_LOGIN_METHOD) + public void setLoginMethod_JsonNullable(JsonNullable loginMethod) { + this.loginMethod = loginMethod; + } + + public void setLoginMethod(String loginMethod) { + this.loginMethod = JsonNullable.of(loginMethod); + } + public UserInvitationDataAttributes uuid(String uuid) { this.uuid = uuid; return this; @@ -183,6 +219,7 @@ public boolean equals(Object o) { return Objects.equals(this.createdAt, userInvitationDataAttributes.createdAt) && Objects.equals(this.expiresAt, userInvitationDataAttributes.expiresAt) && Objects.equals(this.inviteType, userInvitationDataAttributes.inviteType) + && Objects.equals(this.loginMethod, userInvitationDataAttributes.loginMethod) && Objects.equals(this.uuid, userInvitationDataAttributes.uuid) && Objects.equals( this.additionalProperties, userInvitationDataAttributes.additionalProperties); @@ -190,7 +227,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(createdAt, expiresAt, inviteType, uuid, additionalProperties); + return Objects.hash(createdAt, expiresAt, inviteType, loginMethod, uuid, additionalProperties); } @Override @@ -200,6 +237,7 @@ public String toString() { sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n"); sb.append(" inviteType: ").append(toIndentedString(inviteType)).append("\n"); + sb.append(" loginMethod: ").append(toIndentedString(loginMethod)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializable.java b/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializable.java new file mode 100644 index 00000000000..41ae514d161 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializable.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of UserOrgsSerializable object. */ +@JsonPropertyOrder({ + UserOrgsSerializable.JSON_PROPERTY_ATTRIBUTES, + UserOrgsSerializable.JSON_PROPERTY_ID, + UserOrgsSerializable.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserOrgsSerializable { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UserOrgsSerializableAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserOrgsSerializableType type = UserOrgsSerializableType.USERS; + + public UserOrgsSerializable() {} + + @JsonCreator + public UserOrgsSerializable( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) UserOrgsSerializableType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UserOrgsSerializable attributes(UserOrgsSerializableAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of UserOrgsSerializableAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserOrgsSerializableAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UserOrgsSerializableAttributes attributes) { + this.attributes = attributes; + } + + public UserOrgsSerializable id(String id) { + this.id = id; + return this; + } + + /** + * The UserOrgsSerializable id. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UserOrgsSerializable type(UserOrgsSerializableType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of UserOrgsSerializableType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserOrgsSerializableType getType() { + return type; + } + + public void setType(UserOrgsSerializableType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UserOrgsSerializable + */ + @JsonAnySetter + public UserOrgsSerializable putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UserOrgsSerializable object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserOrgsSerializable userOrgsSerializable = (UserOrgsSerializable) o; + return Objects.equals(this.attributes, userOrgsSerializable.attributes) + && Objects.equals(this.id, userOrgsSerializable.id) + && Objects.equals(this.type, userOrgsSerializable.type) + && Objects.equals(this.additionalProperties, userOrgsSerializable.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserOrgsSerializable {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableAttributes.java new file mode 100644 index 00000000000..8d8e0969094 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableAttributes.java @@ -0,0 +1,274 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of UserOrgsSerializableAttributes object. */ +@JsonPropertyOrder({ + UserOrgsSerializableAttributes.JSON_PROPERTY_DISABLED, + UserOrgsSerializableAttributes.JSON_PROPERTY_EMAIL, + UserOrgsSerializableAttributes.JSON_PROPERTY_NAME, + UserOrgsSerializableAttributes.JSON_PROPERTY_ORG_ID, + UserOrgsSerializableAttributes.JSON_PROPERTY_TITLE, + UserOrgsSerializableAttributes.JSON_PROPERTY_VERIFIED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserOrgsSerializableAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DISABLED = "disabled"; + private Boolean disabled; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private String orgId; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_VERIFIED = "verified"; + private Boolean verified; + + public UserOrgsSerializableAttributes disabled(Boolean disabled) { + this.disabled = disabled; + return this; + } + + /** + * The UserOrgsSerializableAttributes disabled. + * + * @return disabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DISABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDisabled() { + return disabled; + } + + public void setDisabled(Boolean disabled) { + this.disabled = disabled; + } + + public UserOrgsSerializableAttributes email(String email) { + this.email = email; + return this; + } + + /** + * The UserOrgsSerializableAttributes email. + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public UserOrgsSerializableAttributes name(String name) { + this.name = name; + return this; + } + + /** + * The UserOrgsSerializableAttributes name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UserOrgsSerializableAttributes orgId(String orgId) { + this.orgId = orgId; + return this; + } + + /** + * The UserOrgsSerializableAttributes org_id. + * + * @return orgId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOrgId() { + return orgId; + } + + public void setOrgId(String orgId) { + this.orgId = orgId; + } + + public UserOrgsSerializableAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The UserOrgsSerializableAttributes title. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public UserOrgsSerializableAttributes verified(Boolean verified) { + this.verified = verified; + return this; + } + + /** + * The UserOrgsSerializableAttributes verified. + * + * @return verified + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVerified() { + return verified; + } + + public void setVerified(Boolean verified) { + this.verified = verified; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UserOrgsSerializableAttributes + */ + @JsonAnySetter + public UserOrgsSerializableAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UserOrgsSerializableAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserOrgsSerializableAttributes userOrgsSerializableAttributes = + (UserOrgsSerializableAttributes) o; + return Objects.equals(this.disabled, userOrgsSerializableAttributes.disabled) + && Objects.equals(this.email, userOrgsSerializableAttributes.email) + && Objects.equals(this.name, userOrgsSerializableAttributes.name) + && Objects.equals(this.orgId, userOrgsSerializableAttributes.orgId) + && Objects.equals(this.title, userOrgsSerializableAttributes.title) + && Objects.equals(this.verified, userOrgsSerializableAttributes.verified) + && Objects.equals( + this.additionalProperties, userOrgsSerializableAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(disabled, email, name, orgId, title, verified, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserOrgsSerializableAttributes {\n"); + sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableType.java b/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableType.java new file mode 100644 index 00000000000..b2a7a499d2b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserOrgsSerializableType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of UserOrgsSerializableType object. */ +@JsonSerialize(using = UserOrgsSerializableType.UserOrgsSerializableTypeSerializer.class) +public class UserOrgsSerializableType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("users")); + + public static final UserOrgsSerializableType USERS = new UserOrgsSerializableType("users"); + + UserOrgsSerializableType(String value) { + super(value, allowedValues); + } + + public static class UserOrgsSerializableTypeSerializer + extends StdSerializer { + public UserOrgsSerializableTypeSerializer(Class t) { + super(t); + } + + public UserOrgsSerializableTypeSerializer() { + this(null); + } + + @Override + public void serialize( + UserOrgsSerializableType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static UserOrgsSerializableType fromValue(String value) { + return new UserOrgsSerializableType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProvider.java b/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProvider.java new file mode 100644 index 00000000000..044995aa7cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProvider.java @@ -0,0 +1,209 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of UserOverrideIdentityProvider object. */ +@JsonPropertyOrder({ + UserOverrideIdentityProvider.JSON_PROPERTY_ATTRIBUTES, + UserOverrideIdentityProvider.JSON_PROPERTY_ID, + UserOverrideIdentityProvider.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserOverrideIdentityProvider { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private UserOverrideIdentityProviderAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private UserOverrideIdentityProviderType type = + UserOverrideIdentityProviderType.IDENTITY_PROVIDERS; + + public UserOverrideIdentityProvider() {} + + @JsonCreator + public UserOverrideIdentityProvider( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + UserOverrideIdentityProviderType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UserOverrideIdentityProvider attributes( + UserOverrideIdentityProviderAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The definition of UserOverrideIdentityProviderAttributes object. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UserOverrideIdentityProviderAttributes getAttributes() { + return attributes; + } + + public void setAttributes(UserOverrideIdentityProviderAttributes attributes) { + this.attributes = attributes; + } + + public UserOverrideIdentityProvider id(String id) { + this.id = id; + return this; + } + + /** + * The UserOverrideIdentityProvider id. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public UserOverrideIdentityProvider type(UserOverrideIdentityProviderType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The definition of UserOverrideIdentityProviderType object. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserOverrideIdentityProviderType getType() { + return type; + } + + public void setType(UserOverrideIdentityProviderType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UserOverrideIdentityProvider + */ + @JsonAnySetter + public UserOverrideIdentityProvider putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UserOverrideIdentityProvider object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserOverrideIdentityProvider userOverrideIdentityProvider = (UserOverrideIdentityProvider) o; + return Objects.equals(this.attributes, userOverrideIdentityProvider.attributes) + && Objects.equals(this.id, userOverrideIdentityProvider.id) + && Objects.equals(this.type, userOverrideIdentityProvider.type) + && Objects.equals( + this.additionalProperties, userOverrideIdentityProvider.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserOverrideIdentityProvider {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderAttributes.java new file mode 100644 index 00000000000..7d21d7030b0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderAttributes.java @@ -0,0 +1,140 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of UserOverrideIdentityProviderAttributes object. */ +@JsonPropertyOrder({UserOverrideIdentityProviderAttributes.JSON_PROPERTY_AUTHENTICATION_METHOD}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UserOverrideIdentityProviderAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHENTICATION_METHOD = "authentication_method"; + private String authenticationMethod; + + public UserOverrideIdentityProviderAttributes authenticationMethod(String authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * The UserOverrideIdentityProviderAttributes authentication_method. + * + * @return authenticationMethod + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHENTICATION_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthenticationMethod() { + return authenticationMethod; + } + + public void setAuthenticationMethod(String authenticationMethod) { + this.authenticationMethod = authenticationMethod; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UserOverrideIdentityProviderAttributes + */ + @JsonAnySetter + public UserOverrideIdentityProviderAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UserOverrideIdentityProviderAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserOverrideIdentityProviderAttributes userOverrideIdentityProviderAttributes = + (UserOverrideIdentityProviderAttributes) o; + return Objects.equals( + this.authenticationMethod, userOverrideIdentityProviderAttributes.authenticationMethod) + && Objects.equals( + this.additionalProperties, userOverrideIdentityProviderAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(authenticationMethod, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserOverrideIdentityProviderAttributes {\n"); + sb.append(" authenticationMethod: ") + .append(toIndentedString(authenticationMethod)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderType.java b/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderType.java new file mode 100644 index 00000000000..2fbf1c40285 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UserOverrideIdentityProviderType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The definition of UserOverrideIdentityProviderType object. */ +@JsonSerialize( + using = UserOverrideIdentityProviderType.UserOverrideIdentityProviderTypeSerializer.class) +public class UserOverrideIdentityProviderType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("identity_providers")); + + public static final UserOverrideIdentityProviderType IDENTITY_PROVIDERS = + new UserOverrideIdentityProviderType("identity_providers"); + + UserOverrideIdentityProviderType(String value) { + super(value, allowedValues); + } + + public static class UserOverrideIdentityProviderTypeSerializer + extends StdSerializer { + public UserOverrideIdentityProviderTypeSerializer(Class t) { + super(t); + } + + public UserOverrideIdentityProviderTypeSerializer() { + this(null); + } + + @Override + public void serialize( + UserOverrideIdentityProviderType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static UserOverrideIdentityProviderType fromValue(String value) { + return new UserOverrideIdentityProviderType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UserResponseIncludedItem.java b/src/main/java/com/datadog/api/client/v2/model/UserResponseIncludedItem.java index 683090594da..b6087f46f05 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UserResponseIncludedItem.java +++ b/src/main/java/com/datadog/api/client/v2/model/UserResponseIncludedItem.java @@ -205,6 +205,96 @@ public UserResponseIncludedItem deserialize(JsonParser jp, DeserializationContex log.log(Level.FINER, "Input data does not match schema 'Role'", e); } + // deserialize UserOverrideIdentityProvider + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (UserOverrideIdentityProvider.class.equals(Integer.class) + || UserOverrideIdentityProvider.class.equals(Long.class) + || UserOverrideIdentityProvider.class.equals(Float.class) + || UserOverrideIdentityProvider.class.equals(Double.class) + || UserOverrideIdentityProvider.class.equals(Boolean.class) + || UserOverrideIdentityProvider.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((UserOverrideIdentityProvider.class.equals(Integer.class) + || UserOverrideIdentityProvider.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((UserOverrideIdentityProvider.class.equals(Float.class) + || UserOverrideIdentityProvider.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (UserOverrideIdentityProvider.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (UserOverrideIdentityProvider.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(UserOverrideIdentityProvider.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((UserOverrideIdentityProvider) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'UserOverrideIdentityProvider'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'UserOverrideIdentityProvider'", e); + } + + // deserialize UserOrgsSerializable + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (UserOrgsSerializable.class.equals(Integer.class) + || UserOrgsSerializable.class.equals(Long.class) + || UserOrgsSerializable.class.equals(Float.class) + || UserOrgsSerializable.class.equals(Double.class) + || UserOrgsSerializable.class.equals(Boolean.class) + || UserOrgsSerializable.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((UserOrgsSerializable.class.equals(Integer.class) + || UserOrgsSerializable.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((UserOrgsSerializable.class.equals(Float.class) + || UserOrgsSerializable.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (UserOrgsSerializable.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (UserOrgsSerializable.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(UserOrgsSerializable.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((UserOrgsSerializable) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'UserOrgsSerializable'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'UserOrgsSerializable'", e); + } + UserResponseIncludedItem ret = new UserResponseIncludedItem(); if (match == 1) { ret.setActualInstance(deserialized); @@ -249,10 +339,22 @@ public UserResponseIncludedItem(Role o) { setActualInstance(o); } + public UserResponseIncludedItem(UserOverrideIdentityProvider o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public UserResponseIncludedItem(UserOrgsSerializable o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("Organization", new GenericType() {}); schemas.put("Permission", new GenericType() {}); schemas.put("Role", new GenericType() {}); + schemas.put("UserOverrideIdentityProvider", new GenericType() {}); + schemas.put("UserOrgsSerializable", new GenericType() {}); JSON.registerDescendants(UserResponseIncludedItem.class, Collections.unmodifiableMap(schemas)); } @@ -263,7 +365,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: Organization, Permission, Role + * against the oneOf child schemas: Organization, Permission, Role, UserOverrideIdentityProvider, + * UserOrgsSerializable * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -282,18 +385,30 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(UserOverrideIdentityProvider.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(UserOrgsSerializable.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); return; } - throw new RuntimeException("Invalid instance type. Must be Organization, Permission, Role"); + throw new RuntimeException( + "Invalid instance type. Must be Organization, Permission, Role," + + " UserOverrideIdentityProvider, UserOrgsSerializable"); } /** - * Get the actual instance, which can be the following: Organization, Permission, Role + * Get the actual instance, which can be the following: Organization, Permission, Role, + * UserOverrideIdentityProvider, UserOrgsSerializable * - * @return The actual instance (Organization, Permission, Role) + * @return The actual instance (Organization, Permission, Role, UserOverrideIdentityProvider, + * UserOrgsSerializable) */ @Override public Object getActualInstance() { @@ -332,4 +447,26 @@ public Permission getPermission() throws ClassCastException { public Role getRole() throws ClassCastException { return (Role) super.getActualInstance(); } + + /** + * Get the actual instance of `UserOverrideIdentityProvider`. If the actual instance is not + * `UserOverrideIdentityProvider`, the ClassCastException will be thrown. + * + * @return The actual instance of `UserOverrideIdentityProvider` + * @throws ClassCastException if the instance is not `UserOverrideIdentityProvider` + */ + public UserOverrideIdentityProvider getUserOverrideIdentityProvider() throws ClassCastException { + return (UserOverrideIdentityProvider) super.getActualInstance(); + } + + /** + * Get the actual instance of `UserOrgsSerializable`. If the actual instance is not + * `UserOrgsSerializable`, the ClassCastException will be thrown. + * + * @return The actual instance of `UserOrgsSerializable` + * @throws ClassCastException if the instance is not `UserOrgsSerializable` + */ + public UserOrgsSerializable getUserOrgsSerializable() throws ClassCastException { + return (UserOrgsSerializable) super.getActualInstance(); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java index 0fa38e78188..f5fe0b56145 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java @@ -12,29 +12,76 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** Attributes of the edited user. */ @JsonPropertyOrder({ + UserUpdateAttributes.JSON_PROPERTY_CREATED_AT, UserUpdateAttributes.JSON_PROPERTY_DISABLED, UserUpdateAttributes.JSON_PROPERTY_EMAIL, - UserUpdateAttributes.JSON_PROPERTY_NAME + UserUpdateAttributes.JSON_PROPERTY_HANDLE, + UserUpdateAttributes.JSON_PROPERTY_MODIFIED_AT, + UserUpdateAttributes.JSON_PROPERTY_NAME, + UserUpdateAttributes.JSON_PROPERTY_SERVICE_ACCOUNT, + UserUpdateAttributes.JSON_PROPERTY_TITLE, + UserUpdateAttributes.JSON_PROPERTY_VERIFIED }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class UserUpdateAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + public static final String JSON_PROPERTY_DISABLED = "disabled"; private Boolean disabled; public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_SERVICE_ACCOUNT = "service_account"; + private Boolean serviceAccount; + + public static final String JSON_PROPERTY_TITLE = "title"; + private JsonNullable title = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_VERIFIED = "verified"; + private Boolean verified; + + public UserUpdateAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The UserUpdateAttributes created_at. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + public UserUpdateAttributes disabled(Boolean disabled) { this.disabled = disabled; return this; @@ -77,6 +124,48 @@ public void setEmail(String email) { this.email = email; } + public UserUpdateAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The UserUpdateAttributes handle. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public UserUpdateAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The UserUpdateAttributes modified_at. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + public UserUpdateAttributes name(String name) { this.name = name; return this; @@ -98,6 +187,79 @@ public void setName(String name) { this.name = name; } + public UserUpdateAttributes serviceAccount(Boolean serviceAccount) { + this.serviceAccount = serviceAccount; + return this; + } + + /** + * The UserUpdateAttributes service_account. + * + * @return serviceAccount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getServiceAccount() { + return serviceAccount; + } + + public void setServiceAccount(Boolean serviceAccount) { + this.serviceAccount = serviceAccount; + } + + public UserUpdateAttributes title(String title) { + this.title = JsonNullable.of(title); + return this; + } + + /** + * The UserUpdateAttributes title. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getTitle() { + return title.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTitle_JsonNullable() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + public void setTitle_JsonNullable(JsonNullable title) { + this.title = title; + } + + public void setTitle(String title) { + this.title = JsonNullable.of(title); + } + + public UserUpdateAttributes verified(Boolean verified) { + this.verified = verified; + return this; + } + + /** + * The UserUpdateAttributes verified. + * + * @return verified + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getVerified() { + return verified; + } + + public void setVerified(Boolean verified) { + this.verified = verified; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -154,24 +316,46 @@ public boolean equals(Object o) { return false; } UserUpdateAttributes userUpdateAttributes = (UserUpdateAttributes) o; - return Objects.equals(this.disabled, userUpdateAttributes.disabled) + return Objects.equals(this.createdAt, userUpdateAttributes.createdAt) + && Objects.equals(this.disabled, userUpdateAttributes.disabled) && Objects.equals(this.email, userUpdateAttributes.email) + && Objects.equals(this.handle, userUpdateAttributes.handle) + && Objects.equals(this.modifiedAt, userUpdateAttributes.modifiedAt) && Objects.equals(this.name, userUpdateAttributes.name) + && Objects.equals(this.serviceAccount, userUpdateAttributes.serviceAccount) + && Objects.equals(this.title, userUpdateAttributes.title) + && Objects.equals(this.verified, userUpdateAttributes.verified) && Objects.equals(this.additionalProperties, userUpdateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(disabled, email, name, additionalProperties); + return Objects.hash( + createdAt, + disabled, + email, + handle, + modifiedAt, + name, + serviceAccount, + title, + verified, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UserUpdateAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" serviceAccount: ").append(toIndentedString(serviceAccount)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/users.feature b/src/test/resources/com/datadog/api/client/v2/api/users.feature index ce27d729985..3e1b1528104 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/users.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/users.feature @@ -151,7 +151,7 @@ Feature: Users Scenario: Update a user returns "Bad Request" response Given new "UpdateUser" request And request contains "user_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} When the request is sent Then the response status is 400 Bad Request @@ -189,6 +189,6 @@ Feature: Users Scenario: Update a user returns "Unprocessable Entity" response Given new "UpdateUser" request And request contains "user_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} When the request is sent Then the response status is 422 Unprocessable Entity