Skip to content

Commit 1163687

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 94cb0f4 of spec repo (DataDog#3452)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 580afba commit 1163687

7 files changed

Lines changed: 486 additions & 1 deletion

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17308,6 +17308,7 @@ components:
1730817308
- $ref: "#/components/schemas/SyntheticsBasicAuthDigest"
1730917309
- $ref: "#/components/schemas/SyntheticsBasicAuthOauthClient"
1731017310
- $ref: "#/components/schemas/SyntheticsBasicAuthOauthROP"
17311+
- $ref: "#/components/schemas/SyntheticsBasicAuthJWT"
1731117312
SyntheticsBasicAuthDigest:
1731217313
description: Object to handle digest authentication when performing the test.
1731317314
properties:
@@ -17335,6 +17336,78 @@ components:
1733517336
type: string
1733617337
x-enum-varnames:
1733717338
- DIGEST
17339+
SyntheticsBasicAuthJWT:
17340+
description: Object to handle JWT authentication when performing the test.
17341+
properties:
17342+
addClaims:
17343+
$ref: "#/components/schemas/SyntheticsBasicAuthJWTAddClaims"
17344+
algorithm:
17345+
$ref: "#/components/schemas/SyntheticsBasicAuthJWTAlgorithm"
17346+
expiresIn:
17347+
description: Token time-to-live in seconds.
17348+
example: 3600
17349+
format: int64
17350+
minimum: 1
17351+
type: integer
17352+
header:
17353+
description: Custom JWT header as a JSON string.
17354+
example: '{"kid": "my-key-id"}'
17355+
type: string
17356+
payload:
17357+
description: JWT claims as a JSON string.
17358+
example: '{"sub": "1234567890", "name": "John Doe"}'
17359+
type: string
17360+
secret:
17361+
description: |-
17362+
Signing key for the JWT authentication. Use the shared secret for `HS256`
17363+
or the private key (PEM format) for `RS256` and `ES256`.
17364+
example: "mysecretkey"
17365+
type: string
17366+
tokenPrefix:
17367+
description: Prefix added before the token in the `Authorization` header. Defaults to `Bearer`.
17368+
example: "Bearer"
17369+
type: string
17370+
type:
17371+
$ref: "#/components/schemas/SyntheticsBasicAuthJWTType"
17372+
required:
17373+
- algorithm
17374+
- payload
17375+
- secret
17376+
- type
17377+
type: object
17378+
SyntheticsBasicAuthJWTAddClaims:
17379+
description: Standard JWT claims to automatically inject.
17380+
properties:
17381+
exp:
17382+
description: Whether to inject the `exp` (expiration) claim.
17383+
example: true
17384+
type: boolean
17385+
iat:
17386+
description: Whether to inject the `iat` (issued at) claim.
17387+
example: true
17388+
type: boolean
17389+
type: object
17390+
SyntheticsBasicAuthJWTAlgorithm:
17391+
description: Algorithm to use for the JWT authentication.
17392+
enum:
17393+
- HS256
17394+
- RS256
17395+
- ES256
17396+
example: "HS256"
17397+
type: string
17398+
x-enum-varnames:
17399+
- HS256
17400+
- RS256
17401+
- ES256
17402+
SyntheticsBasicAuthJWTType:
17403+
default: "jwt"
17404+
description: The type of authentication to use when performing the test.
17405+
enum:
17406+
- jwt
17407+
example: "jwt"
17408+
type: string
17409+
x-enum-varnames:
17410+
- JWT
1733817411
SyntheticsBasicAuthNTLM:
1733917412
description: Object to handle `NTLM` authentication when performing the test.
1734017413
properties:

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,10 @@ def overrides
776776
"v1.synthetics_basic_auth" => "SyntheticsBasicAuth",
777777
"v1.synthetics_basic_auth_digest" => "SyntheticsBasicAuthDigest",
778778
"v1.synthetics_basic_auth_digest_type" => "SyntheticsBasicAuthDigestType",
779+
"v1.synthetics_basic_auth_jwt" => "SyntheticsBasicAuthJWT",
780+
"v1.synthetics_basic_auth_jwt_add_claims" => "SyntheticsBasicAuthJWTAddClaims",
781+
"v1.synthetics_basic_auth_jwt_algorithm" => "SyntheticsBasicAuthJWTAlgorithm",
782+
"v1.synthetics_basic_auth_jwt_type" => "SyntheticsBasicAuthJWTType",
779783
"v1.synthetics_basic_auth_ntlm" => "SyntheticsBasicAuthNTLM",
780784
"v1.synthetics_basic_auth_ntlm_type" => "SyntheticsBasicAuthNTLMType",
781785
"v1.synthetics_basic_auth_oauth_client" => "SyntheticsBasicAuthOauthClient",

lib/datadog_api_client/v1/models/synthetics_basic_auth.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def openapi_one_of
3131
:'SyntheticsBasicAuthNTLM',
3232
:'SyntheticsBasicAuthDigest',
3333
:'SyntheticsBasicAuthOauthClient',
34-
:'SyntheticsBasicAuthOauthROP'
34+
:'SyntheticsBasicAuthOauthROP',
35+
:'SyntheticsBasicAuthJWT'
3536
]
3637
end
3738
# Builds the object
Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
=begin
2+
#Datadog API V1 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V1
20+
# Object to handle JWT authentication when performing the test.
21+
class SyntheticsBasicAuthJWT
22+
include BaseGenericModel
23+
24+
# Standard JWT claims to automatically inject.
25+
attr_accessor :add_claims
26+
27+
# Algorithm to use for the JWT authentication.
28+
attr_reader :algorithm
29+
30+
# Token time-to-live in seconds.
31+
attr_reader :expires_in
32+
33+
# Custom JWT header as a JSON string.
34+
attr_accessor :header
35+
36+
# JWT claims as a JSON string.
37+
attr_reader :payload
38+
39+
# Signing key for the JWT authentication. Use the shared secret for `HS256`
40+
# or the private key (PEM format) for `RS256` and `ES256`.
41+
attr_reader :secret
42+
43+
# Prefix added before the token in the `Authorization` header. Defaults to `Bearer`.
44+
attr_accessor :token_prefix
45+
46+
# The type of authentication to use when performing the test.
47+
attr_reader :type
48+
49+
attr_accessor :additional_properties
50+
51+
# Attribute mapping from ruby-style variable name to JSON key.
52+
# @!visibility private
53+
def self.attribute_map
54+
{
55+
:'add_claims' => :'addClaims',
56+
:'algorithm' => :'algorithm',
57+
:'expires_in' => :'expiresIn',
58+
:'header' => :'header',
59+
:'payload' => :'payload',
60+
:'secret' => :'secret',
61+
:'token_prefix' => :'tokenPrefix',
62+
:'type' => :'type'
63+
}
64+
end
65+
66+
# Attribute type mapping.
67+
# @!visibility private
68+
def self.openapi_types
69+
{
70+
:'add_claims' => :'SyntheticsBasicAuthJWTAddClaims',
71+
:'algorithm' => :'SyntheticsBasicAuthJWTAlgorithm',
72+
:'expires_in' => :'Integer',
73+
:'header' => :'String',
74+
:'payload' => :'String',
75+
:'secret' => :'String',
76+
:'token_prefix' => :'String',
77+
:'type' => :'SyntheticsBasicAuthJWTType'
78+
}
79+
end
80+
81+
# Initializes the object
82+
# @param attributes [Hash] Model attributes in the form of hash
83+
# @!visibility private
84+
def initialize(attributes = {})
85+
if (!attributes.is_a?(Hash))
86+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsBasicAuthJWT` initialize method"
87+
end
88+
89+
self.additional_properties = {}
90+
# check to see if the attribute exists and convert string to symbol for hash key
91+
attributes = attributes.each_with_object({}) { |(k, v), h|
92+
if (!self.class.attribute_map.key?(k.to_sym))
93+
self.additional_properties[k.to_sym] = v
94+
else
95+
h[k.to_sym] = v
96+
end
97+
}
98+
99+
if attributes.key?(:'add_claims')
100+
self.add_claims = attributes[:'add_claims']
101+
end
102+
103+
if attributes.key?(:'algorithm')
104+
self.algorithm = attributes[:'algorithm']
105+
end
106+
107+
if attributes.key?(:'expires_in')
108+
self.expires_in = attributes[:'expires_in']
109+
end
110+
111+
if attributes.key?(:'header')
112+
self.header = attributes[:'header']
113+
end
114+
115+
if attributes.key?(:'payload')
116+
self.payload = attributes[:'payload']
117+
end
118+
119+
if attributes.key?(:'secret')
120+
self.secret = attributes[:'secret']
121+
end
122+
123+
if attributes.key?(:'token_prefix')
124+
self.token_prefix = attributes[:'token_prefix']
125+
end
126+
127+
if attributes.key?(:'type')
128+
self.type = attributes[:'type']
129+
end
130+
end
131+
132+
# Check to see if the all the properties in the model are valid
133+
# @return true if the model is valid
134+
# @!visibility private
135+
def valid?
136+
return false if @algorithm.nil?
137+
return false if !@expires_in.nil? && @expires_in < 1
138+
return false if @payload.nil?
139+
return false if @secret.nil?
140+
return false if @type.nil?
141+
true
142+
end
143+
144+
# Custom attribute writer method with validation
145+
# @param algorithm [Object] Object to be assigned
146+
# @!visibility private
147+
def algorithm=(algorithm)
148+
if algorithm.nil?
149+
fail ArgumentError, 'invalid value for "algorithm", algorithm cannot be nil.'
150+
end
151+
@algorithm = algorithm
152+
end
153+
154+
# Custom attribute writer method with validation
155+
# @param expires_in [Object] Object to be assigned
156+
# @!visibility private
157+
def expires_in=(expires_in)
158+
if !expires_in.nil? && expires_in < 1
159+
fail ArgumentError, 'invalid value for "expires_in", must be greater than or equal to 1.'
160+
end
161+
@expires_in = expires_in
162+
end
163+
164+
# Custom attribute writer method with validation
165+
# @param payload [Object] Object to be assigned
166+
# @!visibility private
167+
def payload=(payload)
168+
if payload.nil?
169+
fail ArgumentError, 'invalid value for "payload", payload cannot be nil.'
170+
end
171+
@payload = payload
172+
end
173+
174+
# Custom attribute writer method with validation
175+
# @param secret [Object] Object to be assigned
176+
# @!visibility private
177+
def secret=(secret)
178+
if secret.nil?
179+
fail ArgumentError, 'invalid value for "secret", secret cannot be nil.'
180+
end
181+
@secret = secret
182+
end
183+
184+
# Custom attribute writer method with validation
185+
# @param type [Object] Object to be assigned
186+
# @!visibility private
187+
def type=(type)
188+
if type.nil?
189+
fail ArgumentError, 'invalid value for "type", type cannot be nil.'
190+
end
191+
@type = type
192+
end
193+
194+
# Returns the object in the form of hash, with additionalProperties support.
195+
# @return [Hash] Returns the object in the form of hash
196+
# @!visibility private
197+
def to_hash
198+
hash = {}
199+
self.class.attribute_map.each_pair do |attr, param|
200+
value = self.send(attr)
201+
if value.nil?
202+
is_nullable = self.class.openapi_nullable.include?(attr)
203+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204+
end
205+
206+
hash[param] = _to_hash(value)
207+
end
208+
self.additional_properties.each_pair do |attr, value|
209+
hash[attr] = value
210+
end
211+
hash
212+
end
213+
214+
# Checks equality by comparing each attribute.
215+
# @param o [Object] Object to be compared
216+
# @!visibility private
217+
def ==(o)
218+
return true if self.equal?(o)
219+
self.class == o.class &&
220+
add_claims == o.add_claims &&
221+
algorithm == o.algorithm &&
222+
expires_in == o.expires_in &&
223+
header == o.header &&
224+
payload == o.payload &&
225+
secret == o.secret &&
226+
token_prefix == o.token_prefix &&
227+
type == o.type &&
228+
additional_properties == o.additional_properties
229+
end
230+
231+
# Calculates hash code according to all attributes.
232+
# @return [Integer] Hash code
233+
# @!visibility private
234+
def hash
235+
[add_claims, algorithm, expires_in, header, payload, secret, token_prefix, type, additional_properties].hash
236+
end
237+
end
238+
end

0 commit comments

Comments
 (0)