diff --git a/.apigentools-info b/.apigentools-info index afa573f21cfe..e95271104229 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-04 20:09:05.103133", - "spec_repo_commit": "ff8b9894" + "regenerated": "2023-05-05 18:11:52.704081", + "spec_repo_commit": "534fc2d7" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-04 20:09:05.120269", - "spec_repo_commit": "ff8b9894" + "regenerated": "2023-05-05 18:11:52.717713", + "spec_repo_commit": "534fc2d7" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d75da1ac92fb..02668fc39aff 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13500,6 +13500,12 @@ components: TeamCreateAttributes: description: Team creation attributes properties: + color: + description: An identifier for the color representing the team + format: int32 + maximum: 13 + minimum: 0 + type: integer description: description: Free-form markdown description/content for the team's homepage type: string diff --git a/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.frozen b/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.frozen index 7f42af9f7b1b..63a97073e5bb 100644 --- a/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.frozen +++ b/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.frozen @@ -1 +1 @@ -2023-03-27T18:33:02.181Z \ No newline at end of file +2023-05-05T17:56:05.119Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.yml b/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.yml index f251b666b611..ad78a80914ee 100644 --- a/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.yml +++ b/cassettes/features/v2/teams/Create-a-team-returns-CREATED-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Mon, 27 Mar 2023 18:33:02 GMT +- recorded_at: Fri, 05 May 2023 17:56:05 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"handle":"1679941982","name":"1679941982"},"relationships":{"users":{"data":[]}},"type":"team"}}' + string: '{"data":{"attributes":{"color":6,"handle":"1683309365","name":"1683309365"},"relationships":{"users":{"data":[]}},"type":"team"}}' headers: Accept: - application/json @@ -14,7 +14,7 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"team","id":"cebec38e-cccd-11ed-a1a8-da7ad0900002","attributes":{"name":"1679941982","handle":"1679941982","summary":null,"description":null,"color":10,"created_at":"2023-03-27T18:33:02.731559+00:00","modified_at":"2023-03-27T18:33:02.731566+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/cebec38e-cccd-11ed-a1a8-da7ad0900002/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/cebec38e-cccd-11ed-a1a8-da7ad0900002/permission-settings"}}}}} + string: '{"data":{"type":"team","id":"1b2ccf7c-eb6e-11ed-8220-da7ad0900002","attributes":{"name":"1683309365","handle":"1683309365","summary":null,"description":null,"color":6,"created_at":"2023-05-05T17:56:05.319858+00:00","modified_at":"2023-05-05T17:56:05.319864+00:00","user_count":0,"link_count":0},"relationships":{"team_links":{"links":{"related":"/api/v2/team/1b2ccf7c-eb6e-11ed-8220-da7ad0900002/links"}},"user_team_permissions":{"links":{"related":"/api/v2/team/1b2ccf7c-eb6e-11ed-8220-da7ad0900002/permission-settings"}}}}} ' headers: @@ -23,14 +23,14 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Mon, 27 Mar 2023 18:33:02 GMT +- recorded_at: Fri, 05 May 2023 17:56:05 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/team/cebec38e-cccd-11ed-a1a8-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/team/1b2ccf7c-eb6e-11ed-8220-da7ad0900002 response: body: encoding: UTF-8 diff --git a/examples/v2/teams/CreateTeam.rb b/examples/v2/teams/CreateTeam.rb index 864464559d4d..61c48fb45d7c 100644 --- a/examples/v2/teams/CreateTeam.rb +++ b/examples/v2/teams/CreateTeam.rb @@ -8,6 +8,7 @@ attributes: DatadogAPIClient::V2::TeamCreateAttributes.new({ handle: "1636629071", name: "1636629071", + color: 6, }), relationships: DatadogAPIClient::V2::TeamCreateRelationships.new({ users: DatadogAPIClient::V2::RelationshipToUsers.new({ diff --git a/features/v2/teams.feature b/features/v2/teams.feature index a68440c97915..2b0760d42005 100644 --- a/features/v2/teams.feature +++ b/features/v2/teams.feature @@ -52,9 +52,12 @@ Feature: Teams @team:DataDog/core-app Scenario: Create a team returns "CREATED" response Given new "CreateTeam" request - And body with value {"data": {"attributes": {"handle": "{{timestamp('now')}}", "name": "{{timestamp('now')}}"}, "relationships": {"users": {"data": []}}, "type": "team"}} + And body with value {"data": {"attributes": {"handle": "{{timestamp('now')}}", "name": "{{timestamp('now')}}", "color": 6}, "relationships": {"users": {"data": []}}, "type": "team"}} When the request is sent Then the response status is 201 CREATED + And the response "data.attributes.handle" is equal to "{{timestamp('now')}}" + And the response "data.attributes.name" is equal to "{{timestamp('now')}}" + And the response "data.attributes.color" is equal to 6 @team:DataDog/core-app Scenario: Get a team link returns "API error response." response diff --git a/lib/datadog_api_client/v2/models/team_create_attributes.rb b/lib/datadog_api_client/v2/models/team_create_attributes.rb index bd436d925012..7aec5a06aa60 100644 --- a/lib/datadog_api_client/v2/models/team_create_attributes.rb +++ b/lib/datadog_api_client/v2/models/team_create_attributes.rb @@ -25,6 +25,9 @@ class TeamCreateAttributes # @!visibility private attr_accessor :_unparsed + # An identifier for the color representing the team + attr_reader :color + # Free-form markdown description/content for the team's homepage attr_accessor :description @@ -41,6 +44,7 @@ class TeamCreateAttributes # @!visibility private def self.attribute_map { + :'color' => :'color', :'description' => :'description', :'handle' => :'handle', :'link_count' => :'link_count', @@ -52,6 +56,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'color' => :'Integer', :'description' => :'String', :'handle' => :'String', :'link_count' => :'Integer', @@ -75,6 +80,10 @@ def initialize(attributes = {}) h[k.to_sym] = v } + if attributes.key?(:'color') + self.color = attributes[:'color'] + end + if attributes.key?(:'description') self.description = attributes[:'description'] end @@ -96,6 +105,8 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if !@color.nil? && @color > 13 + return false if !@color.nil? && @color < 0 return false if @handle.nil? return false if @handle.to_s.length > 64 return false if !@link_count.nil? && @link_count > 2147483647 @@ -104,6 +115,19 @@ def valid? true end + # Custom attribute writer method with validation + # @param color [Object] Object to be assigned + # @!visibility private + def color=(color) + if !color.nil? && color > 13 + fail ArgumentError, 'invalid value for "color", must be smaller than or equal to 13.' + end + if !color.nil? && color < 0 + fail ArgumentError, 'invalid value for "color", must be greater than or equal to 0.' + end + @color = color + end + # Custom attribute writer method with validation # @param handle [Object] Object to be assigned # @!visibility private @@ -146,6 +170,7 @@ def name=(name) def ==(o) return true if self.equal?(o) self.class == o.class && + color == o.color && description == o.description && handle == o.handle && link_count == o.link_count && @@ -156,7 +181,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [description, handle, link_count, name].hash + [color, description, handle, link_count, name].hash end end end